Skip to content

Commit

Permalink
Update the sensors before the joysticks so the gamepad code gets fres…
Browse files Browse the repository at this point in the history
…h sensor readings
  • Loading branch information
slouken committed Jun 20, 2023
1 parent 1a9c04e commit 329e1b8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/events/SDL_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,20 +854,20 @@ static void SDL_PumpEventsInternal(SDL_bool push_sentinel)
_this->PumpEvents(_this);
}

#ifndef SDL_JOYSTICK_DISABLED
/* Check for joystick state change */
if (SDL_update_joysticks) {
SDL_UpdateJoysticks();
}
#endif

#ifndef SDL_SENSOR_DISABLED
/* Check for sensor state change */
if (SDL_update_sensors) {
SDL_UpdateSensors();
}
#endif

#ifndef SDL_JOYSTICK_DISABLED
/* Check for joystick state change */
if (SDL_update_joysticks) {
SDL_UpdateJoysticks();
}
#endif

SDL_SendPendingSignalEvents(); /* in case we had a signal handler fire, etc. */

if (push_sentinel && SDL_EventEnabled(SDL_EVENT_POLL_SENTINEL)) {
Expand Down

0 comments on commit 329e1b8

Please sign in to comment.