aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJody Northup2009-08-15 08:55:22 +0000
committerJody Northup2009-08-15 08:55:22 +0000
commit6ede8310932ab8a79310ebd6b0a14eaf687c1708 (patch)
treec582e444ccfacdfc40a85e38320bcd0eba699233 /backends
parent0af775717e30af665c973283c7df69209525a69a (diff)
downloadscummvm-rg350-6ede8310932ab8a79310ebd6b0a14eaf687c1708.tar.gz
scummvm-rg350-6ede8310932ab8a79310ebd6b0a14eaf687c1708.tar.bz2
scummvm-rg350-6ede8310932ab8a79310ebd6b0a14eaf687c1708.zip
Added hash function for ActionKey in preparation for replacing KeyStates in the main keymapper hashtable with ActionKeys, removed a duplicated comment line.
svn-id: r43397
Diffstat (limited to 'backends')
-rw-r--r--backends/keymapper/keymap.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/backends/keymapper/keymap.h b/backends/keymapper/keymap.h
index 615fd9097d..5bb277c924 100644
--- a/backends/keymapper/keymap.h
+++ b/backends/keymapper/keymap.h
@@ -36,6 +36,7 @@
#include "common/keyboard.h"
#include "common/list.h"
#include "backends/keymapper/action.h"
+#include "backends/keymapper/hardware-key.h"
namespace Common {
@@ -53,6 +54,17 @@ template<> struct Hash<KeyState>
}
};
+/**
+ * Hash function for ActionKey
+ */
+template<> struct Hash<ActionKey>
+ : public UnaryFunction<ActionKey, uint> {
+
+ uint operator()(const ActionKey &val) const {
+ return (uint)val.keycode | ((uint)val.flags << 24);
+ }
+};
+
class Keymap {
public:
Keymap(const String& name, Keymap *parent = 0) : _name(name), _parent(parent) {}
@@ -90,7 +102,6 @@ public:
/**
* Save this keymap's mappings to the config manager
* @note Changes are *not* flushed to disk, to do so call ConfMan.flushToDisk()
- * @note Changes are *not* flushed to disk, to do so call ConfMan.flushToDisk()
*/
void saveMappings();