summaryrefslogtreecommitdiff
path: root/src/gui/sdlinput.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/sdlinput.cpp')
-rw-r--r--src/gui/sdlinput.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp
index 94519469b..6828158d2 100644
--- a/src/gui/sdlinput.cpp
+++ b/src/gui/sdlinput.cpp
@@ -127,7 +127,7 @@ void SDLInput::pushInput(const SDL_Event &event)
keyInput.setMetaPressed(event.key.keysym.mod & KMOD_META);
keyInput.setNumericPad(event.key.keysym.sym >= SDLK_KP0
&& event.key.keysym.sym <= SDLK_KP_EQUALS);
- int actionId = inputManager.getActionByKey(event);
+ const int actionId = inputManager.getActionByKey(event);
if (actionId >= 0)
keyInput.setActionId(actionId);
mKeyInputQueue.push(keyInput);
@@ -135,6 +135,7 @@ void SDLInput::pushInput(const SDL_Event &event)
}
case SDL_KEYUP:
+ {
keyInput.setKey(gcn::Key(convertKeyCharacter(event)));
keyInput.setType(gcn::KeyInput::RELEASED);
keyInput.setShiftPressed(event.key.keysym.mod & KMOD_SHIFT);
@@ -143,9 +144,12 @@ void SDLInput::pushInput(const SDL_Event &event)
keyInput.setMetaPressed(event.key.keysym.mod & KMOD_META);
keyInput.setNumericPad(event.key.keysym.sym >= SDLK_KP0
&& event.key.keysym.sym <= SDLK_KP_EQUALS);
-
+ const int actionId = inputManager.getActionByKey(event);
+ if (actionId >= 0)
+ keyInput.setActionId(actionId);
mKeyInputQueue.push(keyInput);
break;
+ }
case SDL_MOUSEBUTTONDOWN:
mMouseDown = true;