From 15deef50c8855810506db991134a79c94772325b Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 14 Jun 2018 17:24:16 -0400 Subject: [PATCH] Adds a key reset upon screen mode changes in SDL. --- OSBindings/SDL/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OSBindings/SDL/main.cpp b/OSBindings/SDL/main.cpp index 344a86eb9..8fa5f9abb 100644 --- a/OSBindings/SDL/main.cpp +++ b/OSBindings/SDL/main.cpp @@ -461,6 +461,12 @@ int main(int argc, char *argv[]) { fullscreen_mode ^= SDL_WINDOW_FULLSCREEN_DESKTOP; SDL_SetWindowFullscreen(window, fullscreen_mode); SDL_ShowCursor((fullscreen_mode&SDL_WINDOW_FULLSCREEN_DESKTOP) ? SDL_DISABLE : SDL_ENABLE); + + // Announce a potential discontinuity in keyboard input. + auto keyboard_machine = machine->keyboard_machine(); + if(keyboard_machine) { + keyboard_machine->get_keyboard().reset_all_keys(); + } break; }