Use correct controller button->joystick event mapping for SDL joystick polling

This commit is contained in:
SRSaunders 2024-12-06 17:46:51 -05:00
parent 6cb57a5725
commit d655673277

View file

@ -1348,13 +1348,12 @@ sysEvent_t Sys_GetEvent()
{K_JOY_DPAD_LEFT, J_DPAD_LEFT},
{K_JOY_DPAD_RIGHT, J_DPAD_RIGHT},
};
joystick_polls.Append( joystick_poll_t( controllerButtonRemap[ev.cbutton.button][1], ev.cbutton.state == SDL_PRESSED ? 1 : 0 ) );
res.evType = SE_KEY;
res.evValue = controllerButtonRemap[ev.cbutton.button][0];
res.evValue2 = ev.cbutton.state == SDL_PRESSED ? 1 : 0;
joystick_polls.Append( joystick_poll_t( res.evValue, res.evValue2 ) );
joystick_polls.Append( joystick_poll_t( controllerButtonRemap[ev.cbutton.button][1], res.evValue2 ) );
return res;
#else
// WM0110