From a225638721d2bba53c15379d48ddab04d7568e24 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 7 Mar 2014 17:06:23 +0300 Subject: Remove unused events flags. --- src/gui/gui.cpp | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'src/gui/gui.cpp') diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 0b0290be4..d5fbd6e86 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -87,6 +87,7 @@ #include "listeners/keylistener.h" #include "listeners/mouselistener.h" +#include "input/inputmanager.h" #include "input/keydata.h" #include "input/keyinput.h" #include "input/mouseinput.h" @@ -141,10 +142,6 @@ Gui::Gui() : mInput(nullptr), mFocusHandler(new FocusHandler), mKeyListeners(), - mShiftPressed(false), - mMetaPressed(false), - mControlPressed(false), - mAltPressed(false), mLastMousePressButton(0), mLastMousePressTimeStamp(0), mLastMouseX(0), @@ -428,15 +425,8 @@ bool Gui::handleKeyInput() { const KeyInput keyInput = guiInput->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.getType(), keyInput.getActionId(), keyInput.getKey()); #ifdef USE_SDL2 @@ -463,8 +453,7 @@ bool Gui::handleKeyInput() if (mFocusHandler->getFocused()) { KeyEvent keyEvent(getKeyEventSource(), - mShiftPressed, mControlPressed, mAltPressed, mMetaPressed, - keyInput.getType(), keyInput.isNumericPad(), + keyInput.getType(), keyInput.getActionId(), keyInput.getKey()); #ifdef USE_SDL2 if (!keyInput.getText().empty()) @@ -488,7 +477,7 @@ bool Gui::handleKeyInput() == static_cast(Input::KEY_GUI_TAB) && keyInput.getType() == KeyInput::PRESSED) { - if (keyInput.isShiftPressed()) + if (inputManager.isActionActive(Input::KEY_GUI_MOD)) mFocusHandler->tabPrevious(); else mFocusHandler->tabNext(); @@ -852,8 +841,8 @@ void Gui::distributeMouseEvent(Widget* source, int type, int button, return; } - MouseEvent mouseEvent(source, mShiftPressed, mControlPressed, - mAltPressed, mMetaPressed, type, button, + MouseEvent mouseEvent(source, + type, button, x, y, mClickCount); Widget* parent = source; @@ -965,8 +954,8 @@ MouseEvent *Gui::createMouseEvent(Window *const widget) getAbsolutePosition(widget, x, y); getMouseState(&mouseX, &mouseY); - return new MouseEvent(widget, mShiftPressed, - mControlPressed, mAltPressed, mMetaPressed, 0, 0, + return new MouseEvent(widget, + 0, 0, mouseX - x, mouseY - y, mClickCount); } -- cgit v1.2.3-70-g09d2