diff options
author | Jody Northup | 2009-08-15 08:52:40 +0000 |
---|---|---|
committer | Jody Northup | 2009-08-15 08:52:40 +0000 |
commit | 0af775717e30af665c973283c7df69209525a69a (patch) | |
tree | 5bce55c33388f729f9a2cedb6df72df88bf9ce89 | |
parent | 7ea0646a49a848d2cfa1f18162dba66fc6ddef0b (diff) | |
download | scummvm-rg350-0af775717e30af665c973283c7df69209525a69a.tar.gz scummvm-rg350-0af775717e30af665c973283c7df69209525a69a.tar.bz2 scummvm-rg350-0af775717e30af665c973283c7df69209525a69a.zip |
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.
svn-id: r43396
-rw-r--r-- | backends/keymapper/hardware-key.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h index 8c286288ae..94e6589a17 100644 --- a/backends/keymapper/hardware-key.h +++ b/backends/keymapper/hardware-key.h @@ -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,11 +48,15 @@ namespace Common { 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 @@ struct HardwareKey { 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); |