From d593fa58e641aa90d7e1f0759299c59d2665cca6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 31 May 2014 13:41:23 +0300 Subject: Move keyeventtype into separate file. --- src/gui/gui.cpp | 14 +++++++------- src/gui/sdlinput.cpp | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/gui') diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 1fb4cb79f..17ad60ac0 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -439,7 +439,7 @@ bool Gui::handleKeyInput() // change focus. if (!eventConsumed && keyInput.getActionId() == static_cast(InputAction::GUI_TAB) - && keyInput.getType() == KeyInput::PRESSED) + && keyInput.getType() == KeyEventType::PRESSED) { if (inputManager.isActionActive(InputAction::GUI_MOD)) mFocusHandler->tabPrevious(); @@ -1252,17 +1252,17 @@ void Gui::distributeKeyEvent(KeyEvent &event) const std::list keyListeners = widget->getKeyListeners(); - const unsigned int eventType = event.getType(); + const KeyEventType::Type eventType = event.getType(); // Send the event to all key listeners of the source widget. FOR_EACH (std::list::const_iterator, it, keyListeners) { switch (eventType) { - case KeyEvent::PRESSED: + case KeyEventType::PRESSED: (*it)->keyPressed(event); break; - case KeyEvent::RELEASED: + case KeyEventType::RELEASED: (*it)->keyReleased(event); break; default: @@ -1285,15 +1285,15 @@ void Gui::distributeKeyEvent(KeyEvent &event) const void Gui::distributeKeyEventToGlobalKeyListeners(KeyEvent& event) { BLOCK_START("Gui::distributeKeyEventToGlobalKeyListeners") - const unsigned int eventType = event.getType(); + const KeyEventType::Type eventType = event.getType(); FOR_EACH (KeyListenerListIterator, it, mKeyListeners) { switch (eventType) { - case KeyEvent::PRESSED: + case KeyEventType::PRESSED: (*it)->keyPressed(event); break; - case KeyEvent::RELEASED: + case KeyEventType::RELEASED: (*it)->keyReleased(event); break; default: diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp index 6d3121451..665617c8d 100644 --- a/src/gui/sdlinput.cpp +++ b/src/gui/sdlinput.cpp @@ -134,7 +134,7 @@ void SDLInput::pushInput(const SDL_Event &event) { case SDL_KEYDOWN: { - keyInput.setType(KeyInput::PRESSED); + keyInput.setType(KeyEventType::PRESSED); convertKeyEventToKey(event, keyInput); mKeyInputQueue.push(keyInput); break; @@ -142,7 +142,7 @@ void SDLInput::pushInput(const SDL_Event &event) case SDL_KEYUP: { - keyInput.setType(KeyInput::RELEASED); + keyInput.setType(KeyEventType::RELEASED); convertKeyEventToKey(event, keyInput); mKeyInputQueue.push(keyInput); break; @@ -150,7 +150,7 @@ void SDLInput::pushInput(const SDL_Event &event) #ifdef USE_SDL2 case SDL_TEXTINPUT: - keyInput.setType(KeyInput::PRESSED); + keyInput.setType(KeyEventType::PRESSED); keyInput.setKey(Key(Key::TEXTINPUT)); keyInput.setText(event.text.text); mKeyInputQueue.push(keyInput); -- cgit v1.2.3-70-g09d2