diff options
author | asuratva <asuratva@proton.me> | 2024-05-18 10:58:37 +0000 |
---|---|---|
committer | asuratva <asuratva@proton.me> | 2024-05-18 10:58:37 +0000 |
commit | 1d7ee3161693ed016264a4940778a6e4b2258e38 (patch) | |
tree | 059f68cc39a725a0bc64538e5771ef3525aa6ec6 /src/gui/sdlinput.cpp | |
parent | 9294f5a1ba84c7a4e947ab94a2645625e8a6171d (diff) | |
parent | 5570d9d1c2b1b5fba50283ec443088430332bb86 (diff) | |
download | plus-master.tar.gz plus-master.tar.bz2 plus-master.tar.xz plus-master.zip |
Diffstat (limited to 'src/gui/sdlinput.cpp')
-rw-r--r-- | src/gui/sdlinput.cpp | 16 |
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); |