diff options
Diffstat (limited to 'src/input/inputmanager.cpp')
-rw-r--r-- | src/input/inputmanager.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp index 8c5b01a7d..1db2fd07d 100644 --- a/src/input/inputmanager.cpp +++ b/src/input/inputmanager.cpp @@ -738,7 +738,9 @@ bool InputManager::handleEvent(const SDL_Event &restrict event) restrict2 if (gui != nullptr) { const bool res = gui->handleInput(); - if (res && (event.type == SDL_KEYDOWN || event.type == SDL_JOYBUTTONDOWN)) + const bool joystickActionEvent = + joystick != nullptr && joystick->isActionEvent(event); + if (res && (event.type == SDL_KEYDOWN || joystickActionEvent)) { BLOCK_END("InputManager::handleEvent") return true; @@ -1112,7 +1114,7 @@ InputActionT InputManager::getActionByKey(const SDL_Event &restrict event) return idx; } } - if (joystick != nullptr && event.type == SDL_JOYBUTTONDOWN) + if (joystick != nullptr && joystick->isActionEvent(event)) { const InputActionT idx = joystick->getActionId(event); if (CAST_S32(idx) >= 0 && |