From ad94de73d880116b02aa658765e9b32583463c96 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 4 Dec 2009 19:57:33 +0000 Subject: Prevent SDL backend from eating up keypress events with Ctrl+Alt set. svn-id: r46259 --- backends/platform/sdl/events.cpp | 5 ++--- backends/platform/sdl/graphics.cpp | 11 +++++++---- backends/platform/sdl/sdl.h | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'backends/platform/sdl') diff --git a/backends/platform/sdl/events.cpp b/backends/platform/sdl/events.cpp index 4b36de8df0..5905d5f7ee 100644 --- a/backends/platform/sdl/events.cpp +++ b/backends/platform/sdl/events.cpp @@ -297,9 +297,8 @@ bool OSystem_SDL::handleKeyDown(SDL_Event &ev, Common::Event &event) { // Ctrl-Alt- will change the GFX mode if ((b & (Common::KBD_CTRL|Common::KBD_ALT)) == (Common::KBD_CTRL|Common::KBD_ALT)) { - - handleScalerHotkeys(ev.key); - return false; + if (handleScalerHotkeys(ev.key)) + return false; } if (remapKey(ev, event)) diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index 077a9d519c..4a9c88419a 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -1910,7 +1910,7 @@ void OSystem_SDL::displayMessageOnOSD(const char *msg) { #pragma mark --- Misc --- #pragma mark - -void OSystem_SDL::handleScalerHotkeys(const SDL_KeyboardEvent &key) { +bool OSystem_SDL::handleScalerHotkeys(const SDL_KeyboardEvent &key) { // Ctrl-Alt-a toggles aspect ratio correction if (key.keysym.sym == 'a') { beginGFXTransaction(); @@ -1931,7 +1931,7 @@ void OSystem_SDL::handleScalerHotkeys(const SDL_KeyboardEvent &key) { displayMessageOnOSD(buffer); #endif internUpdateScreen(); - return; + return true; } int newMode = -1; @@ -1951,7 +1951,7 @@ void OSystem_SDL::handleScalerHotkeys(const SDL_KeyboardEvent &key) { if (isNormalNumber || isKeypadNumber) { _scalerType = key.keysym.sym - (isNormalNumber ? SDLK_1 : SDLK_KP1); if (_scalerType >= ARRAYSIZE(s_gfxModeSwitchTable)) - return; + return false; while (s_gfxModeSwitchTable[_scalerType][factor] < 0) { assert(factor > 0); @@ -1987,6 +1987,9 @@ void OSystem_SDL::handleScalerHotkeys(const SDL_KeyboardEvent &key) { } #endif internUpdateScreen(); - } + return true; + } else { + return false; + } } diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 6163d21105..a38d76583f 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -492,7 +492,7 @@ protected: virtual bool remapKey(SDL_Event &ev, Common::Event &event); - void handleScalerHotkeys(const SDL_KeyboardEvent &key); + bool handleScalerHotkeys(const SDL_KeyboardEvent &key); }; #endif -- cgit v1.2.3