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

upthorn at users.sourceforge.net upthorn at users.sourceforge.net
Wed Aug 12 11:26:01 CEST 2009


Revision: 43316
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43316&view=rev
Author:   upthorn
Date:     2009-08-12 09:26:00 +0000 (Wed, 12 Aug 2009)

Log Message:
-----------
Laying some groundwork for hopefully getting modifiers working in a less hacked-on manner

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-12 08:56:50 UTC (rev 43315)
+++ scummvm/branches/gsoc2009-16bit/backends/keymapper/hardware-key.h	2009-08-12 09:26:00 UTC (rev 43316)
@@ -37,6 +37,22 @@
 
 #define HWKEY_ID_SIZE (30)
 
+
+// Structure for describing specific key+modifier combos mapped to actions,
+// to allow for modifiers to work properly without having to define the whole 
+// hardware key set an additional time for each possible modifier combination
+struct ActionKey {
+	KeyCode keycode;
+	byte flags;
+	/** unique id used for saving/loading to config */
+	char actKeyId[HWKEY_ID_SIZE];
+
+	/** Human readable description */
+	String description;
+
+};
+
+	
 /**
 * Describes an available hardware key
 */
@@ -56,9 +72,12 @@
 	KeyType type;
 	ActionType preferredAction;
 
+	// Mask of modifiers that can possibly apply to this key.
+	uint32 modMask;
+
 	HardwareKey(const char *i, KeyState ky = KeyState(), String desc = "",
-				KeyType typ = kGenericKeyType, ActionType prefAct = kGenericActionType)
-		: key(ky), description(desc), type(typ), preferredAction(prefAct) {
+				KeyType typ = kGenericKeyType, ActionType prefAct = kGenericActionType, uint32 mods = ~0)
+		: 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