mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-14 18:27:50 +00:00
gamepad: Fix inability to disable SDL_EVENT_GAMEPAD_UPDATE_COMPLETE events
(cherry picked from commit 712c76fdc1)
This commit is contained in:
parent
7939309520
commit
16f6c1058c
1 changed files with 10 additions and 8 deletions
|
|
@ -405,15 +405,17 @@ static bool SDLCALL SDL_GamepadEventWatcher(void *userdata, SDL_Event *event)
|
|||
{
|
||||
SDL_AssertJoysticksLocked();
|
||||
|
||||
for (gamepad = SDL_gamepads; gamepad; gamepad = gamepad->next) {
|
||||
if (gamepad->joystick->instance_id == event->jdevice.which) {
|
||||
SDL_Event deviceevent;
|
||||
if (SDL_EventEnabled(SDL_EVENT_GAMEPAD_UPDATE_COMPLETE)) {
|
||||
for (gamepad = SDL_gamepads; gamepad; gamepad = gamepad->next) {
|
||||
if (gamepad->joystick->instance_id == event->jdevice.which) {
|
||||
SDL_Event deviceevent;
|
||||
|
||||
deviceevent.type = SDL_EVENT_GAMEPAD_UPDATE_COMPLETE;
|
||||
deviceevent.common.timestamp = event->jdevice.timestamp;
|
||||
deviceevent.gdevice.which = event->jdevice.which;
|
||||
SDL_PushEvent(&deviceevent);
|
||||
break;
|
||||
deviceevent.type = SDL_EVENT_GAMEPAD_UPDATE_COMPLETE;
|
||||
deviceevent.common.timestamp = event->jdevice.timestamp;
|
||||
deviceevent.gdevice.which = event->jdevice.which;
|
||||
SDL_PushEvent(&deviceevent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue