mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
Prevent SDL backend from eating up keypress events with Ctrl+Alt set.
svn-id: r46259
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user