Reset the keypad status before reading. Fixes spurious keys being pressed at startup.

This commit is contained in:
thelemonman 2013-11-11 18:06:26 +00:00
parent b4c243fade
commit a57bf33472
1 changed files with 4 additions and 1 deletions

View File

@ -402,10 +402,13 @@ void
process_joystick_events( u16 *keypad) {
SDL_Event event;
/* IMPORTANT: Reenable joystick events iif needed. */
/* IMPORTANT: Reenable joystick events if needed. */
if(SDL_JoystickEventState(SDL_QUERY) == SDL_IGNORE)
SDL_JoystickEventState(SDL_ENABLE);
/* Reset the keypad bits */
*keypad = 0;
/* There's an event waiting to be processed? */
while (SDL_PollEvent(&event))
{