Skip to content

Commit

Permalink
Filter out more events.
Browse files Browse the repository at this point in the history
Removes spurious wakeups.
  • Loading branch information
Themaister committed Nov 20, 2023
1 parent a3d964a commit 598ff5c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions application/input/input_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ bool InputTrackerSDL::init(InputTracker &tracker, const Dispatcher &dispatcher)
SDL_free(gamepad_ids);

// Poll these separately, inline in poll_input().
SDL_SetEventEnabled(SDL_EVENT_GAMEPAD_BUTTON_DOWN, SDL_FALSE);
SDL_SetEventEnabled(SDL_EVENT_GAMEPAD_BUTTON_UP, SDL_FALSE);
SDL_SetEventEnabled(SDL_EVENT_GAMEPAD_AXIS_MOTION, SDL_FALSE);
SDL_SetGamepadEventsEnabled(SDL_FALSE);
SDL_SetJoystickEventsEnabled(SDL_FALSE);
SDL_SetEventEnabled(SDL_EVENT_GAMEPAD_ADDED, SDL_TRUE);
SDL_SetEventEnabled(SDL_EVENT_GAMEPAD_REMOVED, SDL_TRUE);
SDL_SetEventEnabled(SDL_EVENT_JOYSTICK_UPDATE_COMPLETE, SDL_FALSE);
SDL_SetEventEnabled(SDL_EVENT_GAMEPAD_UPDATE_COMPLETE, SDL_FALSE);

return true;
}
Expand Down

0 comments on commit 598ff5c

Please sign in to comment.