[Scummvm-cvs-logs] SF.net SVN: scummvm:[43396] scummvm/branches/gsoc2009-16bit/backends/ keymapper/hardware-key.h

upthorn at users.sourceforge.net upthorn at users.sourceforge.net
Sat Aug 15 10:52:40 CEST 2009


Revision: 43396
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43396&view=rev
Author:   upthorn
Date:     2009-08-15 08:52:40 +0000 (Sat, 15 Aug 2009)

Log Message:
-----------
Added mandatory includes into hardware-key.h (so it can be included without compile error, without having to separately include several other header files), reworked ActionKey structure, changed HardwareKey::modMask from uint32 into byte.

Modified Paths:
--------------
    scummvm/branches/gsoc2009-16bit/backends/keymapper/hardware-key.h

Modified: scummvm/branches/gsoc2009-16bit/backends/keymapper/hardware-key.h
===================================================================
--- scummvm/branches/gsoc2009-16bit/backends/keymapper/hardware-key.h	2009-08-15 08:48:13 UTC (rev 43395)
+++ scummvm/branches/gsoc2009-16bit/backends/keymapper/hardware-key.h	2009-08-15 08:52:40 UTC (rev 43396)
@@ -31,6 +31,10 @@
 #ifdef ENABLE_KEYMAPPER
 
 #include "backends/keymapper/types.h"
+#include "common/str.h"
+#include "common/keyboard.h"
+#include "common/list.h"
+#include "common/util.h"
 
 namespace Common {
 
@@ -44,12 +48,16 @@
 struct ActionKey {
 	KeyCode keycode;
 	byte flags;
-	/** unique id used for saving/loading to config */
-	char actKeyId[HWKEY_ID_SIZE];
 
-	/** Human readable description */
-	String description;
+	ActionKey (KeyCode ky, byte f) { 
+		keycode = ky;
+		flags = f;
+	}
 
+	bool operator ==(const ActionKey &x) const {
+		return keycode == x.keycode && flags == x.flags;
+	}
+
 };
 
 	
@@ -73,10 +81,10 @@
 	ActionType preferredAction;
 
 	// Mask of modifiers that can possibly apply to this key.
-	uint32 modMask;
+	byte modMask;
 
-	HardwareKey(const char *i, KeyState ky = KeyState(), String desc = "",
-				KeyType typ = kGenericKeyType, ActionType prefAct = kGenericActionType, uint32 mods = ~0)
+	HardwareKey(const char *i, KeyState ky = KeyState(), String desc = "", byte mods = ~0,
+				KeyType typ = kGenericKeyType, ActionType prefAct = kGenericActionType)
 		: key(ky), description(desc), type(typ), preferredAction(prefAct), modMask(mods) {
 		assert(i);
 		strncpy(hwKeyId, i, HWKEY_ID_SIZE);


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