SDLControllerInterface: Prefer cbutton.which for button events

Functionally the same as caxis.which due to SDL_Event union, but prefer
using SDL_ControllerButtonEvent members for button events.
pull/584/head
Albert Liu 5 years ago
parent d996f46618
commit 0a0a2024fd

@ -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;

Loading…
Cancel
Save