diff options
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) |