From 6ede8310932ab8a79310ebd6b0a14eaf687c1708 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Sat, 15 Aug 2009 08:55:22 +0000 Subject: 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 --- backends/keymapper/keymap.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'backends') 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 } }; +/** + * Hash function for ActionKey + */ +template<> struct Hash + : public UnaryFunction { + + 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(); -- cgit v1.2.3