[Scummvm-cvs-logs] SF.net SVN: scummvm:[46259] scummvm/trunk/backends/platform/sdl

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Dec 4 20:57:33 CET 2009


Revision: 46259
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46259&view=rev
Author:   lordhoto
Date:     2009-12-04 19:57:33 +0000 (Fri, 04 Dec 2009)

Log Message:
-----------
Prevent SDL backend from eating up keypress events with Ctrl+Alt set.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/sdl/events.cpp
    scummvm/trunk/backends/platform/sdl/graphics.cpp
    scummvm/trunk/backends/platform/sdl/sdl.h

Modified: scummvm/trunk/backends/platform/sdl/events.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/events.cpp	2009-12-04 19:00:40 UTC (rev 46258)
+++ scummvm/trunk/backends/platform/sdl/events.cpp	2009-12-04 19:57:33 UTC (rev 46259)
@@ -297,9 +297,8 @@
 
 	// 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))

Modified: scummvm/trunk/backends/platform/sdl/graphics.cpp
===================================================================
--- scummvm/trunk/backends/platform/sdl/graphics.cpp	2009-12-04 19:00:40 UTC (rev 46258)
+++ scummvm/trunk/backends/platform/sdl/graphics.cpp	2009-12-04 19:57:33 UTC (rev 46259)
@@ -1910,7 +1910,7 @@
 #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 @@
 		displayMessageOnOSD(buffer);
 #endif
 		internUpdateScreen();
-		return;
+		return true;
 	}
 
 	int newMode = -1;
@@ -1951,7 +1951,7 @@
 	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 @@
 		}
 #endif
 		internUpdateScreen();
+
+		return true;
+	} else {
+		return false;
 	}
-
 }

Modified: scummvm/trunk/backends/platform/sdl/sdl.h
===================================================================
--- scummvm/trunk/backends/platform/sdl/sdl.h	2009-12-04 19:00:40 UTC (rev 46258)
+++ scummvm/trunk/backends/platform/sdl/sdl.h	2009-12-04 19:57:33 UTC (rev 46259)
@@ -492,7 +492,7 @@
 
 	virtual bool remapKey(SDL_Event &ev, Common::Event &event);
 
-	void handleScalerHotkeys(const SDL_KeyboardEvent &key);
+	bool handleScalerHotkeys(const SDL_KeyboardEvent &key);
 };
 
 #endif


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list