22#ifndef COMMON_KEYMAP_H
23#define COMMON_KEYMAP_H
25#include "common/scummsys.h"
27#include "backends/keymapper/hardware-input.h"
29#include "common/config-manager.h"
30#include "common/func.h"
31#include "common/hashmap.h"
32#include "common/hash-ptr.h"
33#include "common/list.h"
34#include "common/str-array.h"
38const char *
const kStandardActionsKeymapName =
"standard-actions";
43class HardwareInputSet;
44class KeymapperDefaultBindings;
48 return (x.type == y.type)
49 && (x.key.keycode == y.key.keycode)
50 && (x.key.flags == y.key.flags)
51 && (x.inputCode == y.inputCode);
58 hash = 31 * hash + x.type;
59 hash = 31 * hash + x.key.keycode;
60 hash = 31 * hash + x.key.flags;
61 hash = 31 * hash + x.inputCode;
157 const String &getId()
const {
return _id; }
158 const U32String &getDescription()
const {
return _description; }
159 KeymapType getType()
const {
return _type; }
161 bool isPartialMatchAllowed()
const {
return _partialMatchAllowed; }
162 void setPartialMatchAllowed(
bool partialMatchAllowed) { _partialMatchAllowed = partialMatchAllowed; }
168 void setEnabled(
bool enabled) { _enabled = enabled; }
177 const Action *findAction(
const char *
id)
const;
187 bool _partialMatchAllowed;
190 ActionArray _actions;
191 HardwareActionMap _hwActionMap;
198typedef Array<Keymap *> KeymapArray;
Definition: config-manager.h:59
static Array< Keymap * > arrayOf(Keymap *keymap)
Definition: keymap.h:171
void unregisterMapping(Action *action)
Array< HardwareInput > getActionMapping(const Action *action) const
KeymapMatch getMappedActions(const Event &event, ActionArray &actions) const
void resetMapping(Action *action)
const ActionArray & getActions() const
Definition: keymap.h:135
bool isEnabled() const
Definition: keymap.h:167
void registerMapping(Action *action, const HardwareInput &input)
void addAction(Action *action)
StringArray getActionDefaultMappings(Action *action)
Definition: keymapper-defaults.h:32
Definition: algorithm.h:29