From a57bf3347218d150e3c43c442b1690e18b3b0ea0 Mon Sep 17 00:00:00 2001 From: thelemonman Date: Mon, 11 Nov 2013 18:06:26 +0000 Subject: [PATCH] Reset the keypad status before reading. Fixes spurious keys being pressed at startup. --- desmume/src/ctrlssdl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desmume/src/ctrlssdl.cpp b/desmume/src/ctrlssdl.cpp index 8590a5fd3..191bdefc9 100644 --- a/desmume/src/ctrlssdl.cpp +++ b/desmume/src/ctrlssdl.cpp @@ -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)) {