diff --git a/src/frontend-common/sdl_controller_interface.cpp b/src/frontend-common/sdl_controller_interface.cpp index a2c54ed52..fab613b22 100644 --- a/src/frontend-common/sdl_controller_interface.cpp +++ b/src/frontend-common/sdl_controller_interface.cpp @@ -319,7 +319,7 @@ bool SDLControllerInterface::HandleControllerButtonEvent(const SDL_Event* ev) Log_DebugPrintf("controller %d button %d %s", ev->cbutton.which, ev->cbutton.button, ev->cbutton.state == SDL_PRESSED ? "pressed" : "released"); - auto it = GetControllerDataForJoystickId(ev->caxis.which); + auto it = GetControllerDataForJoystickId(ev->cbutton.which); if (it == m_controllers.end()) return false;