From d4e2dc88611252748b8dc3bb70baf56fc8bd2256 Mon Sep 17 00:00:00 2001 From: QuantumDriftDev <350698041+QuantumDriftDev@users.noreply.github.com> Date: Sat, 31 Oct 2026 14:33:08 +0100 Subject: 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> --- src/input_common/drivers/sdl_driver.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/input_common/drivers') 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) { -- cgit v1.2.3