Reset the keypad status before reading. Fixes spurious keys being pressed at startup.
This commit is contained in:
parent
b4c243fade
commit
a57bf33472
|
@ -402,10 +402,13 @@ void
|
||||||
process_joystick_events( u16 *keypad) {
|
process_joystick_events( u16 *keypad) {
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
|
|
||||||
/* IMPORTANT: Reenable joystick events iif needed. */
|
/* IMPORTANT: Reenable joystick events if needed. */
|
||||||
if(SDL_JoystickEventState(SDL_QUERY) == SDL_IGNORE)
|
if(SDL_JoystickEventState(SDL_QUERY) == SDL_IGNORE)
|
||||||
SDL_JoystickEventState(SDL_ENABLE);
|
SDL_JoystickEventState(SDL_ENABLE);
|
||||||
|
|
||||||
|
/* Reset the keypad bits */
|
||||||
|
*keypad = 0;
|
||||||
|
|
||||||
/* There's an event waiting to be processed? */
|
/* There's an event waiting to be processed? */
|
||||||
while (SDL_PollEvent(&event))
|
while (SDL_PollEvent(&event))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue