mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-07-10 14:57:29 +00:00
Improved handling of binding buttons and axes
(cherry picked from commit 71f3bf90edce26083056215124e65881f6c6ad26)
This commit is contained in:
parent
0a9f61fbf1
commit
b8d5fa4aef
|
@ -501,9 +501,7 @@ WatchJoystick(SDL_Joystick *joystick)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SDL_JOYBALLMOTION:
|
case SDL_JOYBUTTONUP:
|
||||||
break;
|
|
||||||
case SDL_JOYBUTTONDOWN:
|
|
||||||
if (event.jbutton.which == nJoystickID) {
|
if (event.jbutton.which == nJoystickID) {
|
||||||
SDL_GameControllerExtendedBind binding;
|
SDL_GameControllerExtendedBind binding;
|
||||||
|
|
||||||
|
@ -546,10 +544,10 @@ WatchJoystick(SDL_Joystick *joystick)
|
||||||
|
|
||||||
SDL_Delay(15);
|
SDL_Delay(15);
|
||||||
|
|
||||||
/* Wait 100 ms for joystick events to stop coming in,
|
/* Wait 30 ms for joystick events to stop coming in,
|
||||||
in case a controller sends multiple events for a single control (e.g. axis and button for trigger)
|
in case a controller sends multiple events for a single control (e.g. axis and button for trigger)
|
||||||
*/
|
*/
|
||||||
if (s_unPendingAdvanceTime && SDL_GetTicks() - s_unPendingAdvanceTime >= 100) {
|
if (s_unPendingAdvanceTime && SDL_GetTicks() - s_unPendingAdvanceTime >= 30) {
|
||||||
SetCurrentBinding(s_iCurrentBinding + 1);
|
SetCurrentBinding(s_iCurrentBinding + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue