[Scummvm-cvs-logs] CVS: scummvm/backends/sdl events.cpp,1.13,1.14 sdl-common.h,1.69,1.70

Max Horn fingolfin at users.sourceforge.net
Thu Dec 30 06:49:07 CET 2004


Update of /cvsroot/scummvm/scummvm/backends/sdl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31933

Modified Files:
	events.cpp sdl-common.h 
Log Message:
Swallow ctrl-alt keyup events, too

Index: events.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/events.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- events.cpp	30 Dec 2004 14:11:00 -0000	1.13
+++ events.cpp	30 Dec 2004 14:48:21 -0000	1.14
@@ -392,69 +392,20 @@
 			event.kbd.keycode = ev.key.keysym.sym;
 			event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
 #endif
-
-/* Disabled mouse emulation code (fingolfin, 2004-12-18).
-   I am keeping the rest of the code in for now, since the joystick
-   code (or rather, "hack") uses it, too.
-			switch(ev.key.keysym.sym) {
-			case SDLK_LEFT:
-				_km.x_vel = -1;
-				_km.x_down_count = 1;
-				break;
-			case SDLK_RIGHT:
-				_km.x_vel =  1;
-				_km.x_down_count = 1;
-				break;
-			case SDLK_UP:
-				_km.y_vel = -1;
-				_km.y_down_count = 1;
-				break;
-			case SDLK_DOWN:
-				_km.y_vel =  1;
-				_km.y_down_count = 1;
-				break;
-			default:
-				break;
-			}
-*/
 			return true;
 	
 		case SDL_KEYUP:
 			event.type = EVENT_KEYUP;
 			event.kbd.keycode = ev.key.keysym.sym;
 			event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
-			event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState());;
+			event.kbd.flags = SDLModToOSystemKeyFlags(SDL_GetModState());
 
-/*
-			switch(ev.key.keysym.sym) {
-			case SDLK_LEFT:
-				if (_km.x_vel < 0) {
-					_km.x_vel = 0;
-					_km.x_down_count = 0;
-				}
-				break;
-			case SDLK_RIGHT:
-				if (_km.x_vel > 0) {
-					_km.x_vel = 0;
-					_km.x_down_count = 0;
-				}
-				break;
-			case SDLK_UP:
-				if (_km.y_vel < 0) {
-					_km.y_vel = 0;
-					_km.y_down_count = 0;
-				}
-				break;
-			case SDLK_DOWN:
-				if (_km.y_vel > 0) {
-					_km.y_vel = 0;
-					_km.y_down_count = 0;
-				}
-				break;
-			default:
+			// Ctrl-Alt-<key> will change the GFX mode
+			if ((b & (KBD_CTRL|KBD_ALT)) == (KBD_CTRL|KBD_ALT)) {
+				// Swallow these key up events
 				break;
 			}
-*/
+
 			return true;
 
 		case SDL_MOUSEMOTION:

Index: sdl-common.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.h,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- sdl-common.h	11 Dec 2004 15:17:47 -0000	1.69
+++ sdl-common.h	30 Dec 2004 14:48:21 -0000	1.70
@@ -204,7 +204,7 @@
 		kTransactionActive = 2
 	};
 
-	struct transactionDetails {
+	struct TransactionDetails {
 		int mode;
 		bool modeChanged;
 		int w;
@@ -215,7 +215,8 @@
 		bool fsChanged;
 		bool ar;
 		bool arChanged;
-	} _transactionDetails;
+	};
+	TransactionDetails _transactionDetails;
 
 	/** Force full redraw on next updateScreen */
 	bool _forceFull;
@@ -248,7 +249,9 @@
 	bool _cksumValid;
 	int _cksumNum;
 
-	// Keyboard mouse emulation
+	// Keyboard mouse emulation.  Disabled by fingolfin 2004-12-18.
+	// I am keeping the rest of the code in for now, since the joystick
+	// code (or rather, "hack") uses it, too.
 	struct KbdMouse {	
 		int16 x, y, x_vel, y_vel, x_max, y_max, x_down_count, y_down_count;
 		uint32 last_time, delay_time, x_down_time, y_down_time;





More information about the Scummvm-git-logs mailing list