[Scummvm-cvs-logs] SF.net SVN: scummvm:[48476] scummvm/branches/branch-1-1-0/backends/platform /maemo/scummvm-1.1.0-maemo.patch

fanoush at users.sourceforge.net fanoush at users.sourceforge.net
Fri Apr 2 23:59:41 CEST 2010


Revision: 48476
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48476&view=rev
Author:   fanoush
Date:     2010-04-02 21:59:40 +0000 (Fri, 02 Apr 2010)

Log Message:
-----------
fix handling of ctrl/shift/alt modifiers when remapping keys

Modified Paths:
--------------
    scummvm/branches/branch-1-1-0/backends/platform/maemo/scummvm-1.1.0-maemo.patch

Modified: scummvm/branches/branch-1-1-0/backends/platform/maemo/scummvm-1.1.0-maemo.patch
===================================================================
--- scummvm/branches/branch-1-1-0/backends/platform/maemo/scummvm-1.1.0-maemo.patch	2010-04-02 18:51:20 UTC (rev 48475)
+++ scummvm/branches/branch-1-1-0/backends/platform/maemo/scummvm-1.1.0-maemo.patch	2010-04-02 21:59:40 UTC (rev 48476)
@@ -1005,8 +1005,8 @@
  
  OSystem::MutexRef OSystem_SDL::createMutex() {
  	return (MutexRef) SDL_CreateMutex();
---- scummvm-1.1.orig/backends/platform/sdl/events.cpp	2010-03-21 22:01:52.000000000 +0100
-+++ scummvm-1.1/backends/platform/sdl/events.cpp	2010-03-24 01:02:34.000000000 +0100
+--- scummvm-1.1.orig/backends/platform/sdl/events.cpp	2010-04-02 22:45:24.000000000 +0200
++++ scummvm-1.1/backends/platform/sdl/events.cpp	2010-04-02 22:44:04.000000000 +0200
 @@ -26,7 +26,9 @@
  #include "backends/platform/sdl/sdl.h"
  #include "common/util.h"
@@ -1018,7 +1018,22 @@
  // 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
-@@ -241,8 +243,13 @@
+@@ -232,8 +234,13 @@
+ 
+ bool OSystem_SDL::handleKeyDown(SDL_Event &ev, Common::Event &event) {
+ 
++#ifdef MAEMO_SDL
++// we want to remap first including ctr/shift/alt modifiers
++	const bool event_complete = remapKey(ev, event);
++	SDLModToOSystemKeyFlags(ev.key.keysym.mod, event);  
++#else
+ 	SDLModToOSystemKeyFlags(SDL_GetModState(), event);
+-
++#endif
+ 	// Handle scroll lock as a key modifier
+ 	if (ev.key.keysym.sym == SDLK_SCROLLOCK)
+ 		_scrollLock = !_scrollLock;
+@@ -241,8 +248,13 @@
  	if (_scrollLock)
  		event.kbd.flags |= Common::KBD_SCRL;
  
@@ -1032,7 +1047,7 @@
  		beginGFXTransaction();
  			setFullscreenMode(!_videoMode.fullscreen);
  		endGFXTransaction();
-@@ -276,11 +283,15 @@
+@@ -276,11 +288,15 @@
  		return false;
  	}
  
@@ -1048,7 +1063,32 @@
  
  #if defined(MACOSX)
  	// On Macintosh', Cmd-Q quits
-@@ -355,8 +366,20 @@
+@@ -313,7 +329,11 @@
+ 			return false;
+ 	}
+ 
++#ifdef MAEMO_SDL
++	if (event_complete)
++#else
+ 	if (remapKey(ev, event))
++#endif
+ 		return true;
+ 
+ 	event.type = Common::EVENT_KEYDOWN;
+@@ -332,7 +352,12 @@
+ 	event.kbd.ascii = mapKey(ev.key.keysym.sym, ev.key.keysym.mod, ev.key.keysym.unicode);
+ 
+ 	// Ctrl-Alt-<key> will change the GFX mode
++#ifdef MAEMO_SDL
++	// we can't call SDL_GetModState(), modifiers can be remapped too
++	SDLModToOSystemKeyFlags(ev.key.keysym.mod, event);  
++#else
+ 	SDLModToOSystemKeyFlags(SDL_GetModState(), event);
++#endif
+ 
+ 	// Set the scroll lock sticky flag
+ 	if (_scrollLock)
+@@ -355,8 +380,20 @@
  }
  
  bool OSystem_SDL::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) {
@@ -1069,7 +1109,7 @@
  	else if (ev.button.button == SDL_BUTTON_RIGHT)
  		event.type = Common::EVENT_RBUTTONDOWN;
  #if defined(SDL_BUTTON_WHEELUP) && defined(SDL_BUTTON_WHEELDOWN)
-@@ -372,14 +395,33 @@
+@@ -372,14 +409,33 @@
  	else
  		return false;
  
@@ -1103,7 +1143,7 @@
  	else if (ev.button.button == SDL_BUTTON_RIGHT)
  		event.type = Common::EVENT_RBUTTONUP;
  #if defined(SDL_BUTTON_MIDDLE)
-@@ -503,7 +545,203 @@
+@@ -503,7 +559,203 @@
  	return true;
  }
  


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