aboutsummaryrefslogtreecommitdiff
path: root/backends/keymapper
diff options
context:
space:
mode:
authorJody Northup2009-08-12 09:26:00 +0000
committerJody Northup2009-08-12 09:26:00 +0000
commit77594f46b1db7ed6bde4413f74d12a48e720cbfa (patch)
treef02ad2ae7355d9d7cac616ba7aa33ab2b37c0a64 /backends/keymapper
parent1b47344cc173ae424e84d8b0eea6e4d0c84f506c (diff)
downloadscummvm-rg350-77594f46b1db7ed6bde4413f74d12a48e720cbfa.tar.gz
scummvm-rg350-77594f46b1db7ed6bde4413f74d12a48e720cbfa.tar.bz2
scummvm-rg350-77594f46b1db7ed6bde4413f74d12a48e720cbfa.zip
Laying some groundwork for hopefully getting modifiers working in a less hacked-on manner
svn-id: r43316
Diffstat (limited to 'backends/keymapper')
-rw-r--r--backends/keymapper/hardware-key.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h
index 34631a9484..8c286288ae 100644
--- a/backends/keymapper/hardware-key.h
+++ b/backends/keymapper/hardware-key.h
@@ -37,6 +37,22 @@ namespace Common {
#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 @@ struct HardwareKey {
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);
}