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.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp
index 9b8b1ec6a..8f3ca8bff 100644
--- a/src/gui/sdlinput.cpp
+++ b/src/gui/sdlinput.cpp
@@ -171,6 +171,22 @@ void SDLInput::pushInput(const SDL_Event &event)
break;
}
+ case SDL_JOYBUTTONDOWN:
+ case SDL_JOYHATMOTION:
+ case SDL_JOYAXISMOTION:
+ {
+ const InputActionT actionId = inputManager.getActionByKey(event);
+ if (actionId > InputAction::NO_VALUE)
+ {
+ keyInput.setActionId(actionId);
+ keyInput.setType(KeyEventType::PRESSED);
+ mKeyInputQueue.push(keyInput);
+ keyInput.setType(KeyEventType::RELEASED);
+ mKeyInputQueue.push(keyInput);
+ }
+ break;
+ }
+
#ifdef USE_SDL2
case SDL_TEXTINPUT:
keyInput.setType(KeyEventType::PRESSED);