Prevent SDL backend from eating up keypress events with Ctrl+Alt set.

svn-id: r46259
This commit is contained in:
Johannes Schickel
2009-12-04 19:57:33 +00:00
parent 01e12310ae
commit ad94de73d8
3 changed files with 10 additions and 8 deletions
+2 -3
View File
@@ -297,9 +297,8 @@ bool OSystem_SDL::handleKeyDown(SDL_Event &ev, Common::Event &event) {
// Ctrl-Alt-<key> 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))
+7 -4
View File
@@ -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;
}
}
+1 -1
View File
@@ -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