[Scummvm-cvs-logs] SF.net SVN: scummvm: [27654] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Jun 23 12:06:40 CEST 2007


Revision: 27654
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27654&view=rev
Author:   fingolfin
Date:     2007-06-23 03:06:39 -0700 (Sat, 23 Jun 2007)

Log Message:
-----------
Added more flexible KeyState constructor; updated comment in gui/Key.h

Modified Paths:
--------------
    scummvm/trunk/common/keyboard.h
    scummvm/trunk/gui/Key.h

Modified: scummvm/trunk/common/keyboard.h
===================================================================
--- scummvm/trunk/common/keyboard.h	2007-06-23 09:35:32 UTC (rev 27653)
+++ scummvm/trunk/common/keyboard.h	2007-06-23 10:06:39 UTC (rev 27654)
@@ -233,6 +233,7 @@
 	 * and look at that, if you want to find out a key code.
 	 */
 	KeyCode keycode;
+
 	/**
 	 * ASCII-value of the pressed key (if any).
 	 * This depends on modifiers, i.e. pressing the 'A' key results in
@@ -240,6 +241,7 @@
 	 * caps lock.
 	 */
 	uint16 ascii;
+
 	/**
 	 * Status of the modifier keys. Bits are set in this for each
 	 * pressed modifier
@@ -247,7 +249,12 @@
 	 */
 	byte flags;
 	
-	KeyState() { reset(); }
+	KeyState(KeyCode kc = KEYCODE_INVALID, uint16 asc = 0, byte f = 0) {
+		keycode = kc;
+		ascii = asc ? asc : (uint16)kc;
+		flags = f;
+	}
+	
 	void reset() {
 		keycode = KEYCODE_INVALID;
 		ascii = flags = 0;

Modified: scummvm/trunk/gui/Key.h
===================================================================
--- scummvm/trunk/gui/Key.h	2007-06-23 09:35:32 UTC (rev 27653)
+++ scummvm/trunk/gui/Key.h	2007-06-23 10:06:39 UTC (rev 27654)
@@ -32,7 +32,11 @@
 
 namespace GUI {
 
-// TODO/FIXME: Make use of Common::KeyState from common/keyboard.h
+// TODO/FIXME: Make use of Common::KeyState from common/keyboard.h,
+// or even better, just completely replace this by it.
+// To be able to do that, though, the code using GUI::Key would need to
+// be adopted -- right now it uses SDL keycodes, and uses SDL_PushEvent
+// to generated fake events.
 
 class Key {
 public:


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