summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-31 13:41:23 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-31 13:41:23 +0300
commitd593fa58e641aa90d7e1f0759299c59d2665cca6 (patch)
treebdbce97f8a9ad8fb1f80477ea603e0452daf4614 /src/gui
parent1072eecf0e9e9140796d24f82d077199b2a1d9e6 (diff)
downloadplus-d593fa58e641aa90d7e1f0759299c59d2665cca6.tar.gz
plus-d593fa58e641aa90d7e1f0759299c59d2665cca6.tar.bz2
plus-d593fa58e641aa90d7e1f0759299c59d2665cca6.tar.xz
plus-d593fa58e641aa90d7e1f0759299c59d2665cca6.zip
Move keyeventtype into separate file.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.cpp14
-rw-r--r--src/gui/sdlinput.cpp6
2 files changed, 10 insertions, 10 deletions
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<int>(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<KeyListener*> 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<KeyListener*>::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);