diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-03 01:29:22 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-03 01:29:22 +0300 |
commit | 5e4a1bf239d76a5525a4409dc7a2094fbffe0eb3 (patch) | |
tree | 2563cd7dd22fb1370b0311e9b7b45b8657f9ecdf /src/guichan | |
parent | a56d6c4d316551940982d622e9b0e3b0f1ad1863 (diff) | |
download | mv-5e4a1bf239d76a5525a4409dc7a2094fbffe0eb3.tar.gz mv-5e4a1bf239d76a5525a4409dc7a2094fbffe0eb3.tar.bz2 mv-5e4a1bf239d76a5525a4409dc7a2094fbffe0eb3.tar.xz mv-5e4a1bf239d76a5525a4409dc7a2094fbffe0eb3.zip |
Put gui input logic before most game input logic.
This solving game and gui shortcuts conflicts.
Diffstat (limited to 'src/guichan')
-rw-r--r-- | src/guichan/gui.cpp | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/src/guichan/gui.cpp b/src/guichan/gui.cpp index 5a3e16784..bd811014f 100644 --- a/src/guichan/gui.cpp +++ b/src/guichan/gui.cpp @@ -128,22 +128,6 @@ namespace gcn void Gui::logic() { - if (!mTop) - throw GCN_EXCEPTION("No top widget set"); - - handleModalFocus(); - handleModalMouseInputFocus(); - - if (mInput) - { - mInput->_pollInput(); - - handleKeyInput(); - handleMouseInput(); - - } // end if - - mTop->logic(); } void Gui::draw() @@ -241,68 +225,6 @@ namespace gcn void Gui::handleKeyInput() { - while (!mInput->isKeyQueueEmpty()) - { - KeyInput keyInput = mInput->dequeueKeyInput(); - - // Save modifiers state - mShiftPressed = keyInput.isShiftPressed(); - mMetaPressed = keyInput.isMetaPressed(); - mControlPressed = keyInput.isControlPressed(); - mAltPressed = keyInput.isAltPressed(); - - KeyEvent keyEventToGlobalKeyListeners(nullptr, - mShiftPressed, - mControlPressed, - mAltPressed, - mMetaPressed, - keyInput.getType(), - keyInput.isNumericPad(), - keyInput.getKey()); - - distributeKeyEventToGlobalKeyListeners( - keyEventToGlobalKeyListeners); - - // If a global key listener consumes the event it will not be - // sent further to the source of the event. - if (keyEventToGlobalKeyListeners.isConsumed()) - continue; - - bool keyEventConsumed = false; - - // Send key inputs to the focused widgets - if (mFocusHandler->getFocused()) - { - KeyEvent keyEvent(getKeyEventSource(), - mShiftPressed, - mControlPressed, - mAltPressed, - mMetaPressed, - keyInput.getType(), - keyInput.isNumericPad(), - keyInput.getKey()); - - if (!mFocusHandler->getFocused()->isFocusable()) - mFocusHandler->focusNone(); - else - distributeKeyEvent(keyEvent); - - keyEventConsumed = keyEvent.isConsumed(); - } - - // If the key event hasn't been consumed and - // tabbing is enable check for tab press and - // change focus. - if (!keyEventConsumed && mTabbing - && keyInput.getKey().getValue() == Key::TAB - && keyInput.getType() == KeyInput::PRESSED) - { - if (keyInput.isShiftPressed()) - mFocusHandler->tabPrevious(); - else - mFocusHandler->tabNext(); - } - } // end while } void Gui::handleMouseMoved(const MouseInput& mouseInput) |