diff options
| author | QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com> | 2026-10-31 14:33:08 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-31 14:33:08 +0100 |
| commit | d4e2dc88611252748b8dc3bb70baf56fc8bd2256 (patch) | |
| tree | 88cf5a92002f58efee5de70df65fe40519a45b01 /src/input_common | |
| parent | 7b6f27b91e0ecaebcc4d66ee7dd3855bebce6c78 (diff) | |
Fix game list crash, unresponsive macOS menu, and missing SDL gamepad input (#100)
* game_list: fix crash when scanning games by removing nested event processing
Assisted-by: DeepSeek V4 Pro (root cause diagnosis and fix)
Signed-off-by: QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com>
* macos: fix unresponsive application menu by removing the SDL/Qt event loop conflict
Assisted-by: GPT-6.1 Sol (root cause diagnosis and implementation)
Signed-off-by: QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com>
* input_common: handle SDL gamepad button and axis events
Assisted-by: DeepSeek V4 Pro (implementation)
Signed-off-by: QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com>
---------
Signed-off-by: QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com>
Diffstat (limited to 'src/input_common')
| -rw-r--r-- | src/input_common/drivers/sdl_driver.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index c3e9a066b3..1f1f9543f4 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp @@ -589,6 +589,15 @@ void SDLDriver::HandleGameControllerEvent(const SDL_Event& event) { } break; } + case SDL_EVENT_GAMEPAD_BUTTON_DOWN: + case SDL_EVENT_GAMEPAD_BUTTON_UP: { + const bool down = event.type == SDL_EVENT_GAMEPAD_BUTTON_DOWN; + if (const auto joystick = GetSDLJoystickBySDLID(event.gbutton.which)) { + const PadIdentifier identifier = joystick->GetPadIdentifier(); + SetButton(identifier, event.gbutton.button, down); + } + break; + } case SDL_EVENT_JOYSTICK_HAT_MOTION: { if (const auto joystick = GetSDLJoystickBySDLID(event.jhat.which)) { const PadIdentifier identifier = joystick->GetPadIdentifier(); @@ -603,6 +612,13 @@ void SDLDriver::HandleGameControllerEvent(const SDL_Event& event) { } break; } + case SDL_EVENT_GAMEPAD_AXIS_MOTION: { + if (const auto joystick = GetSDLJoystickBySDLID(event.gaxis.which)) { + const PadIdentifier identifier = joystick->GetPadIdentifier(); + SetAxis(identifier, event.gaxis.axis, event.gaxis.value / 32767.0f); + } + break; + } case SDL_EVENT_GAMEPAD_SENSOR_UPDATE: { auto joystick = GetSDLJoystickByGamepadID(event.gsensor.which); if (!joystick) { |
