[Scummvm-cvs-logs] CVS: scummvm/backends/sdl sdl-common.cpp,1.103,1.104

Jonathan Gray khalek at users.sourceforge.net
Wed Jan 21 20:32:03 CET 2004


Update of /cvsroot/scummvm/scummvm/backends/sdl
In directory sc8-pr-cvs1:/tmp/cvs-serv5512

Modified Files:
	sdl-common.cpp 
Log Message:
patch #878551 from Gael Le Mignot, adds key mappings for yopy PDAs, a host option to the configure script for cross compilation and sdl prefix option.  Also remove obsolete sdlgl option from configure script and change the --disable-bs options to be --disable-sword to be consistent while I'm here

Index: sdl-common.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- sdl-common.cpp	6 Jan 2004 12:45:27 -0000	1.103
+++ sdl-common.cpp	22 Jan 2004 04:31:31 -0000	1.104
@@ -19,14 +19,19 @@
  *
  */
 
-#include "sdl-common.h"
+#include "backends/sdl/sdl-common.h"
 #include "sound/mididrv.h"
 #include "common/config-manager.h"
 #include "common/scaler.h"
 #include "common/util.h"
 
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
 #include "scummvm.xpm"
 
+
 // FIXME move joystick defines out and replace with confile file options
 // we should really allow users to map any key to a joystick button
 #define JOY_DEADZONE 3200
@@ -595,12 +600,21 @@
 	while(SDL_PollEvent(&ev)) {
 		switch(ev.type) {
 		case SDL_KEYDOWN:
+#ifdef LINUPY
+			// Yopy has no ALT key, steal the SHIFT key 
+			// (which isn't used much anyway)
+			if (ev.key.keysym.mod & KMOD_SHIFT)
+				b |= KBD_ALT;
+			if (ev.key.keysym.mod & KMOD_CTRL)
+				b |= KBD_CTRL;
+#else
 			if (ev.key.keysym.mod & KMOD_SHIFT)
 				b |= KBD_SHIFT;
 			if (ev.key.keysym.mod & KMOD_CTRL)
 				b |= KBD_CTRL;
 			if (ev.key.keysym.mod & KMOD_ALT)
 				b |= KBD_ALT;
+#endif
 			event->kbd.flags = b;
 
 			// Alt-Return toggles full screen mode				
@@ -714,6 +728,35 @@
 				}
 			}
 
+#ifdef LINUPY
+			// On Yopy map the End button to quit
+			if ((ev.key.keysym.sym==293)) {
+				event->event_code = EVENT_QUIT;
+				return true;
+			}
+			// Map menu key to f5 (scumm menu)
+			if (ev.key.keysym.sym==306) {
+				event->event_code = EVENT_KEYDOWN;
+				event->kbd.keycode = SDLK_F5;
+				event->kbd.ascii = mapKey(SDLK_F5, ev.key.keysym.mod, 0);
+				return true;
+			}
+			// Map action key to action
+			if (ev.key.keysym.sym==291) {
+				event->event_code = EVENT_KEYDOWN;
+				event->kbd.keycode = SDLK_TAB;
+				event->kbd.ascii = mapKey(SDLK_TAB, ev.key.keysym.mod, 0);
+				return true;
+			}
+			// Map OK key to skip cinematic
+			if (ev.key.keysym.sym==292) {
+				event->event_code = EVENT_KEYDOWN;
+				event->kbd.keycode = SDLK_ESCAPE;
+				event->kbd.ascii = mapKey(SDLK_ESCAPE, ev.key.keysym.mod, 0);
+				return true;
+			}
+#endif
+
 #ifdef QTOPIA
 			// quit on fn+backspace on zaurus
 			if (ev.key.keysym.sym == 127) {





More information about the Scummvm-git-logs mailing list