aboutsummaryrefslogtreecommitdiff
path: root/backends/keymapper/hardware-input.h
diff options
context:
space:
mode:
authorTarek Soliman2012-02-28 06:38:07 -0600
committerTarek Soliman2012-02-28 06:45:35 -0600
commit477c1b9a87046f17c165e66f566d91d0906a8fcd (patch)
treec4e487294b97d8bd7a10af1d1514353367b7befa /backends/keymapper/hardware-input.h
parent4d1e6c3d54fc692697144ebe2d4799fa67f30203 (diff)
downloadscummvm-rg350-477c1b9a87046f17c165e66f566d91d0906a8fcd.tar.gz
scummvm-rg350-477c1b9a87046f17c165e66f566d91d0906a8fcd.tar.bz2
scummvm-rg350-477c1b9a87046f17c165e66f566d91d0906a8fcd.zip
KEYMAPPER: HardwareInputSet now has defaults
Ports can add additional special keys. SDL no longer carries the static tables. Default behavior unchanged: HardwareInputSet() still gives an empty one.
Diffstat (limited to 'backends/keymapper/hardware-input.h')
-rw-r--r--backends/keymapper/hardware-input.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/backends/keymapper/hardware-input.h b/backends/keymapper/hardware-input.h
index eb165e7b8b..9396765bbe 100644
--- a/backends/keymapper/hardware-input.h
+++ b/backends/keymapper/hardware-input.h
@@ -85,12 +85,11 @@ public:
/**
* Add hardware input keys to the set out of key and modifier tables.
- * @param keys table of available keys
- * @param modifiers table of available modifiers
+ * @param useDefault auto-add the built-in default inputs
+ * @param keys table of available keys
+ * @param modifiers table of available modifiers
*/
- HardwareInputSet(const KeyTableEntry keys[], const ModifierTableEntry modifiers[]);
-
- HardwareInputSet() { }
+ HardwareInputSet(bool useDefault = false, const KeyTableEntry keys[] = 0, const ModifierTableEntry modifiers[] = 0);
virtual ~HardwareInputSet();
@@ -100,13 +99,9 @@ public:
const HardwareInput *findHardwareInput(const KeyState& keystate) const;
- const List<const HardwareInput *> &getHardwareInputs() const {
- return _inputs;
- }
+ const List<const HardwareInput *> &getHardwareInputs() const { return _inputs; }
- uint size() const {
- return _inputs.size();
- }
+ uint size() const { return _inputs.size(); }
/**
* Add hardware inputs to the set out of key and modifier tables.
@@ -115,9 +110,16 @@ public:
*/
void addHardwareInputs(const KeyTableEntry keys[], const ModifierTableEntry modifiers[]);
-private:
+ /**
+ * Add hardware inputs to the set out of a key table.
+ * The default modifiers are applied to the key entries
+ * @param keys table of available keys
+ */
+ void addHardwareInputs(const KeyTableEntry keys[]);
- void checkForInput(const HardwareInput *input);
+ void removeHardwareInput(const HardwareInput *input);
+
+private:
List<const HardwareInput *> _inputs;
};