diff options
author | Tarek Soliman | 2012-02-24 13:23:55 -0600 |
---|---|---|
committer | Tarek Soliman | 2012-02-27 13:00:56 -0600 |
commit | 6afac4e01eba5c297e99597dd2cb17c2e4732a7e (patch) | |
tree | da3a7473c70f529a7cc399975349607d412eb713 /backends/keymapper | |
parent | b0f961924a856b71ebffdb834db122145c4c10e5 (diff) | |
download | scummvm-rg350-6afac4e01eba5c297e99597dd2cb17c2e4732a7e.tar.gz scummvm-rg350-6afac4e01eba5c297e99597dd2cb17c2e4732a7e.tar.bz2 scummvm-rg350-6afac4e01eba5c297e99597dd2cb17c2e4732a7e.zip |
KEYMAPPER: Rename HardwareKey to HardwareInput
Diffstat (limited to 'backends/keymapper')
-rw-r--r-- | backends/keymapper/action.cpp | 16 | ||||
-rw-r--r-- | backends/keymapper/action.h | 10 | ||||
-rw-r--r-- | backends/keymapper/hardware-input.h (renamed from backends/keymapper/hardware-key.h) | 72 | ||||
-rw-r--r-- | backends/keymapper/keymap.cpp | 64 | ||||
-rw-r--r-- | backends/keymapper/keymap.h | 20 | ||||
-rw-r--r-- | backends/keymapper/keymapper-defaults.h | 8 | ||||
-rw-r--r-- | backends/keymapper/keymapper.cpp | 28 | ||||
-rw-r--r-- | backends/keymapper/keymapper.h | 20 | ||||
-rw-r--r-- | backends/keymapper/remap-dialog.cpp | 32 |
9 files changed, 135 insertions, 135 deletions
diff --git a/backends/keymapper/action.cpp b/backends/keymapper/action.cpp index e5b2d9415a..33f5c423b0 100644 --- a/backends/keymapper/action.cpp +++ b/backends/keymapper/action.cpp @@ -29,7 +29,7 @@ namespace Common { Action::Action(Keymap *boss, const char *i, String des) - : _boss(boss), description(des), _hwKey(0) { + : _boss(boss), description(des), _hwInput(0) { assert(i); assert(_boss); @@ -38,18 +38,18 @@ Action::Action(Keymap *boss, const char *i, String des) _boss->addAction(this); } -void Action::mapKey(const HardwareKey *key) { - if (_hwKey) +void Action::mapInput(const HardwareInput *input) { + if (_hwInput) _boss->unregisterMapping(this); - _hwKey = key; + _hwInput = input; - if (_hwKey) - _boss->registerMapping(this, _hwKey); + if (_hwInput) + _boss->registerMapping(this, _hwInput); } -const HardwareKey *Action::getMappedKey() const { - return _hwKey; +const HardwareInput *Action::getMappedInput() const { + return _hwInput; } } // End of namespace Common diff --git a/backends/keymapper/action.h b/backends/keymapper/action.h index 3132260512..5e69ed3918 100644 --- a/backends/keymapper/action.h +++ b/backends/keymapper/action.h @@ -34,7 +34,7 @@ namespace Common { -struct HardwareKey; +struct HardwareInput; class Keymap; #define ACTION_ID_SIZE (4) @@ -55,8 +55,8 @@ struct Action { List<Event> events; private: - /** Hardware key that is mapped to this Action */ - const HardwareKey *_hwKey; + /** Hardware input that is mapped to this Action */ + const HardwareInput *_hwInput; Keymap *_boss; public: @@ -97,8 +97,8 @@ public: return _boss; } - void mapKey(const HardwareKey *key); - const HardwareKey *getMappedKey() const; + void mapInput(const HardwareInput *input); + const HardwareInput *getMappedInput() const; }; diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-input.h index 9fd8d1981a..70e0f986fa 100644 --- a/backends/keymapper/hardware-key.h +++ b/backends/keymapper/hardware-input.h @@ -32,9 +32,9 @@ namespace Common { /** -* Describes an available hardware key +* Describes an available hardware input */ -struct HardwareKey { +struct HardwareInput { /** unique id used for saving/loading to config */ String id; @@ -47,7 +47,7 @@ struct HardwareKey { */ KeyState key; - HardwareKey(String i, KeyState ky = KeyState(), String desc = "") + HardwareInput(String i, KeyState ky = KeyState(), String desc = "") : id(i), key(ky), description(desc) { } }; @@ -73,70 +73,70 @@ struct ModifierTableEntry { }; /** - * Simple class to encapsulate a device's set of HardwareKeys. - * Each device should instantiate this and call addHardwareKey a number of times + * Simple class to encapsulate a device's set of HardwareInputs. + * Each device should instantiate this and call addHardwareInput a number of times * in its constructor to define the device's available keys. */ -class HardwareKeySet { +class HardwareInputSet { public: /** - * Add hardware keys to the set out of key and modifier tables. + * 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 */ - HardwareKeySet(const KeyTableEntry keys[], const ModifierTableEntry modifiers[]) { - addHardwareKeys(keys, modifiers); + HardwareInputSet(const KeyTableEntry keys[], const ModifierTableEntry modifiers[]) { + addHardwareInputs(keys, modifiers); } - HardwareKeySet() { } + HardwareInputSet() { } - virtual ~HardwareKeySet() { - List<const HardwareKey *>::const_iterator it; + virtual ~HardwareInputSet() { + List<const HardwareInput *>::const_iterator it; - for (it = _keys.begin(); it != _keys.end(); it++) + for (it = _inputs.begin(); it != _inputs.end(); it++) delete *it; } - void addHardwareKey(const HardwareKey *key) { - checkForKey(key); - _keys.push_back(key); + void addHardwareInput(const HardwareInput *input) { + checkForInput(input); + _inputs.push_back(input); } - const HardwareKey *findHardwareKey(String id) const { - List<const HardwareKey *>::const_iterator it; + const HardwareInput *findHardwareInput(String id) const { + List<const HardwareInput *>::const_iterator it; - for (it = _keys.begin(); it != _keys.end(); it++) { + for (it = _inputs.begin(); it != _inputs.end(); it++) { if ((*it)->id == id) return (*it); } return 0; } - const HardwareKey *findHardwareKey(const KeyState& keystate) const { - List<const HardwareKey *>::const_iterator it; + const HardwareInput *findHardwareInput(const KeyState& keystate) const { + List<const HardwareInput *>::const_iterator it; - for (it = _keys.begin(); it != _keys.end(); it++) { + for (it = _inputs.begin(); it != _inputs.end(); it++) { if ((*it)->key == keystate) return (*it); } return 0; } - const List<const HardwareKey *> &getHardwareKeys() const { - return _keys; + const List<const HardwareInput *> &getHardwareInputs() const { + return _inputs; } uint size() const { - return _keys.size(); + return _inputs.size(); } /** - * Add hardware keys to the set out of key and modifier tables. + * Add hardware inputs to the set out of key and modifier tables. * @param keys table of available keys * @param modifiers table of available modifiers */ - void addHardwareKeys(const KeyTableEntry keys[], const ModifierTableEntry modifiers[]) { + void addHardwareInputs(const KeyTableEntry keys[], const ModifierTableEntry modifiers[]) { const KeyTableEntry *key; const ModifierTableEntry *mod; char fullKeyId[50]; @@ -159,25 +159,25 @@ public: snprintf(fullKeyDesc, 100, "%s%s", mod->desc, key->desc); } - addHardwareKey(new HardwareKey(fullKeyId, KeyState(key->keycode, ascii, mod->flag), fullKeyDesc)); + addHardwareInput(new HardwareInput(fullKeyId, KeyState(key->keycode, ascii, mod->flag), fullKeyDesc)); } } } private: - void checkForKey(const HardwareKey *key) { - List<const HardwareKey *>::iterator it; + void checkForInput(const HardwareInput *input) { + List<const HardwareInput *>::iterator it; - for (it = _keys.begin(); it != _keys.end(); it++) { - if ((*it)->id == key->id) - error("Error adding HardwareKey '%s' - id of %s already in use!", key->description.c_str(), key->id.c_str()); - else if ((*it)->key == key->key) - error("Error adding HardwareKey '%s' - key already in use!", key->description.c_str()); + for (it = _inputs.begin(); it != _inputs.end(); it++) { + if ((*it)->id == input->id) + error("Error adding HardwareInput '%s' - id of %s already in use!", input->description.c_str(), input->id.c_str()); + else if ((*it)->key == input->key) + error("Error adding HardwareInput '%s' - key already in use!", input->description.c_str()); } } - List<const HardwareKey *> _keys; + List<const HardwareInput *> _inputs; }; } // End of namespace Common diff --git a/backends/keymapper/keymap.cpp b/backends/keymapper/keymap.cpp index 3913fd149e..8ea975c927 100644 --- a/backends/keymapper/keymap.cpp +++ b/backends/keymapper/keymap.cpp @@ -26,7 +26,7 @@ #include "common/system.h" -#include "backends/keymapper/hardware-key.h" +#include "backends/keymapper/hardware-input.h" #include "backends/keymapper/keymapper-defaults.h" #define KEYMAP_KEY_PREFIX "keymap_" @@ -37,10 +37,10 @@ Keymap::Keymap(const Keymap& km) : _actions(km._actions), _keymap(), _configDoma List<Action *>::iterator it; for (it = _actions.begin(); it != _actions.end(); ++it) { - const HardwareKey *hwKey = (*it)->getMappedKey(); + const HardwareInput *hwInput = (*it)->getMappedInput(); - if (hwKey) { - _keymap[hwKey->key] = *it; + if (hwInput) { + _keymap[hwInput->key] = *it; } } } @@ -59,24 +59,24 @@ void Keymap::addAction(Action *action) { _actions.push_back(action); } -void Keymap::registerMapping(Action *action, const HardwareKey *hwKey) { +void Keymap::registerMapping(Action *action, const HardwareInput *hwInput) { HashMap<KeyState, Action *>::iterator it; - it = _keymap.find(hwKey->key); + it = _keymap.find(hwInput->key); // if key is already mapped to a different action then un-map it if (it != _keymap.end() && action != it->_value) { - it->_value->mapKey(0); + it->_value->mapInput(0); } - _keymap[hwKey->key] = action; + _keymap[hwInput->key] = action; } void Keymap::unregisterMapping(Action *action) { - const HardwareKey *hwKey = action->getMappedKey(); + const HardwareInput *hwInput = action->getMappedInput(); - if (hwKey) { - _keymap.erase(hwKey->key); + if (hwInput) { + _keymap.erase(hwInput->key); } } @@ -120,7 +120,7 @@ void Keymap::setConfigDomain(ConfigManager::Domain *dom) { _configDomain = dom; } -void Keymap::loadMappings(const HardwareKeySet *hwKeys) { +void Keymap::loadMappings(const HardwareInputSet *hwKeys) { if (!_configDomain) return; @@ -129,7 +129,7 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) { Common::KeymapperDefaultBindings *defaults = g_system->getKeymapperDefaultBindings(); - HashMap<String, const HardwareKey *> mappedKeys; + HashMap<String, const HardwareInput *> mappedInputs; List<Action*>::iterator it; String prefix = KEYMAP_KEY_PREFIX + _name + "_"; @@ -138,37 +138,37 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) { String actionId(ua->id); String confKey = prefix + actionId; - String hwKeyId = _configDomain->getVal(confKey); + String hwInputId = _configDomain->getVal(confKey); bool defaulted = false; // fall back to the platform-specific defaults - if (hwKeyId.empty() && defaults) { - hwKeyId = defaults->getDefaultBinding(_name, actionId); - if (!hwKeyId.empty()) + if (hwInputId.empty() && defaults) { + hwInputId = defaults->getDefaultBinding(_name, actionId); + if (!hwInputId.empty()) defaulted = true; } // there's no mapping - if (hwKeyId.empty()) + if (hwInputId.empty()) continue; - const HardwareKey *hwKey = hwKeys->findHardwareKey(hwKeyId.c_str()); + const HardwareInput *hwInput = hwKeys->findHardwareInput(hwInputId.c_str()); - if (!hwKey) { - warning("HardwareKey with ID '%s' not known", hwKeyId.c_str()); + if (!hwInput) { + warning("HardwareInput with ID '%s' not known", hwInputId.c_str()); continue; } if (defaulted) { - if (mappedKeys.contains(hwKeyId)) { - debug(1, "Action [%s] not falling back to hardcoded default value [%s] because the key is in use", confKey.c_str(), hwKeyId.c_str()); + if (mappedInputs.contains(hwInputId)) { + debug(1, "Action [%s] not falling back to hardcoded default value [%s] because the hardware input is in use", confKey.c_str(), hwInputId.c_str()); continue; } - warning("Action [%s] fell back to hardcoded default value [%s]", confKey.c_str(), hwKeyId.c_str()); + warning("Action [%s] fell back to hardcoded default value [%s]", confKey.c_str(), hwInputId.c_str()); } - mappedKeys.setVal(hwKeyId, hwKey); + mappedInputs.setVal(hwInputId, hwInput); // map the key - ua->mapKey(hwKey); + ua->mapInput(hwInput); } } @@ -187,27 +187,27 @@ void Keymap::saveMappings() { String actId((*it)->id, (*it)->id + actIdLen); String hwId = ""; - if ((*it)->getMappedKey()) { - hwId = (*it)->getMappedKey()->id; + if ((*it)->getMappedInput()) { + hwId = (*it)->getMappedInput()->id; } _configDomain->setVal(prefix + actId, hwId); } } -bool Keymap::isComplete(const HardwareKeySet *hwKeys) { +bool Keymap::isComplete(const HardwareInputSet *hwInputs) { List<Action *>::iterator it; bool allMapped = true; uint numberMapped = 0; for (it = _actions.begin(); it != _actions.end(); ++it) { - if ((*it)->getMappedKey()) { - numberMapped++; + if ((*it)->getMappedInput()) { + ++numberMapped; } else { allMapped = false; } } - return allMapped || (numberMapped == hwKeys->size()); + return allMapped || (numberMapped == hwInputs->size()); } } // End of namespace Common diff --git a/backends/keymapper/keymap.h b/backends/keymapper/keymap.h index 2e9f08533e..4c3e89700f 100644 --- a/backends/keymapper/keymap.h +++ b/backends/keymapper/keymap.h @@ -36,8 +36,8 @@ namespace Common { -struct HardwareKey; -class HardwareKeySet; +struct HardwareInput; +class HardwareInputSet; /** * Hash function for KeyState @@ -80,9 +80,9 @@ public: /** * Load this keymap's mappings from the config manager. - * @param hwKeys the set to retrieve hardware key pointers from + * @param hwInputs the set to retrieve hardware input pointers from */ - void loadMappings(const HardwareKeySet *hwKeys); + void loadMappings(const HardwareInputSet *hwInputs); /** * Save this keymap's mappings to the config manager @@ -93,9 +93,9 @@ public: /** * Returns true if all UserAction's in Keymap are mapped, or, - * all HardwareKey's from the given set have been used up. + * all HardwareInputs from the given set have been used up. */ - bool isComplete(const HardwareKeySet *hwKeys); + bool isComplete(const HardwareInputSet *hwInputs); const String& getName() { return _name; } @@ -110,15 +110,15 @@ private: void addAction(Action *action); /** - * Registers a HardwareKey to the given Action + * Registers a HardwareInput to the given Action * @param action Action in this Keymap - * @param key pointer to HardwareKey to map + * @param key pointer to HardwareInput to map * @see Action::mapKey */ - void registerMapping(Action *action, const HardwareKey *key); + void registerMapping(Action *action, const HardwareInput *input); /** - * Unregisters a HardwareKey from the given Action (if one is mapped) + * Unregisters a HardwareInput from the given Action (if one is mapped) * @param action Action in this Keymap * @see Action::mapKey */ diff --git a/backends/keymapper/keymapper-defaults.h b/backends/keymapper/keymapper-defaults.h index 5b84ebeaa9..bd4afd4e3a 100644 --- a/backends/keymapper/keymapper-defaults.h +++ b/backends/keymapper/keymapper-defaults.h @@ -35,17 +35,17 @@ namespace Common { class KeymapperDefaultBindings : HashMap<String, String> { public: /** - * This sets a default hwKey for a given Keymap Action + * This sets a default hwInput for a given Keymap Action * @param keymapId String representing Keymap id (Keymap.name) * @param actionId String representing Action id (Action.id) - * @param hwKeyId String representing the HardwareKey id (HardwareKey.hwKeyId) + * @param hwInputId String representing the HardwareInput id (HardwareInput.id) */ - void setDefaultBinding(String keymapId, String actionId, String hwKeyId) { setVal(keymapId + "_" + actionId, hwKeyId); } + void setDefaultBinding(String keymapId, String actionId, String hwInputId) { setVal(keymapId + "_" + actionId, hwInputId); } /** * This retrieves the assigned default hwKey for a given Keymap Action * @param keymapId String representing Keymap id (Keymap.name) * @param actionId String representing Action id (Action.id) - * @return hwKeyId String representing the HardwareKey id (HardwareKey.hwKeyId) + * @return String representing the HardwareInput id (HardwareInput.id) */ String getDefaultBinding(String keymapId, String actionId) { return getVal(keymapId + "_" + actionId); } }; diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp index 189f862469..719902ef20 100644 --- a/backends/keymapper/keymapper.cpp +++ b/backends/keymapper/keymapper.cpp @@ -54,26 +54,26 @@ Keymap *Keymapper::Domain::getKeymap(const String& name) { } Keymapper::Keymapper(EventManager *evtMgr) - : _eventMan(evtMgr), _enabled(true), _hardwareKeys(0) { + : _eventMan(evtMgr), _enabled(true), _hardwareInputs(0) { ConfigManager::Domain *confDom = ConfMan.getDomain(ConfigManager::kKeymapperDomain); _globalDomain.setConfigDomain(confDom); } Keymapper::~Keymapper() { - delete _hardwareKeys; + delete _hardwareInputs; } -void Keymapper::registerHardwareKeySet(HardwareKeySet *keys) { - if (_hardwareKeys) - error("Hardware key set already registered"); +void Keymapper::registerHardwareInputSet(HardwareInputSet *inputs) { + if (_hardwareInputs) + error("Hardware input set already registered"); - if (!keys) { - warning("No hardware keys are supplied"); + if (!inputs) { + warning("No hardware input are supplied"); return; } - _hardwareKeys = keys; + _hardwareInputs = inputs; } void Keymapper::addGlobalKeymap(Keymap *keymap) { @@ -95,15 +95,15 @@ void Keymapper::addGameKeymap(Keymap *keymap) { } void Keymapper::initKeymap(Domain &domain, Keymap *map) { - if (!_hardwareKeys) { - warning("No hardware keys were registered yet (%s)", map->getName().c_str()); + if (!_hardwareInputs) { + warning("No hardware inputs were registered yet (%s)", map->getName().c_str()); return; } map->setConfigDomain(domain.getConfigDomain()); - map->loadMappings(_hardwareKeys); + map->loadMappings(_hardwareInputs); - if (map->isComplete(_hardwareKeys) == false) { + if (map->isComplete(_hardwareInputs) == false) { map->saveMappings(); ConfMan.flushToDisk(); } @@ -291,8 +291,8 @@ List<Event> Keymapper::executeAction(const Action *action, bool keyDown) { return mappedEvents; } -const HardwareKey *Keymapper::findHardwareKey(const KeyState& key) { - return (_hardwareKeys) ? _hardwareKeys->findHardwareKey(key) : 0; +const HardwareInput *Keymapper::findHardwareInput(const KeyState& key) { + return (_hardwareInputs) ? _hardwareInputs->findHardwareInput(key) : 0; } } // End of namespace Common diff --git a/backends/keymapper/keymapper.h b/backends/keymapper/keymapper.h index 31bfcbc080..daa746f379 100644 --- a/backends/keymapper/keymapper.h +++ b/backends/keymapper/keymapper.h @@ -31,7 +31,7 @@ #include "common/list.h" #include "common/hashmap.h" #include "common/stack.h" -#include "backends/keymapper/hardware-key.h" +#include "backends/keymapper/hardware-input.h" #include "backends/keymapper/keymap.h" namespace Common { @@ -81,17 +81,17 @@ public: virtual List<Event> mapEvent(const Event &ev, EventSource *source); /** - * Registers a HardwareKeySet with the Keymapper + * Registers a HardwareInputSet with the Keymapper * @note should only be called once (during backend initialisation) */ - void registerHardwareKeySet(HardwareKeySet *keys); + void registerHardwareInputSet(HardwareInputSet *inputs); /** - * Get a list of all registered HardwareKeys + * Get a list of all registered HardwareInputs */ - const List<const HardwareKey *> &getHardwareKeys() const { - assert(_hardwareKeys); - return _hardwareKeys->getHardwareKeys(); + const List<const HardwareInput *> &getHardwareInputs() const { + assert(_hardwareInputs); + return _hardwareInputs->getHardwareInputs(); } /** @@ -168,9 +168,9 @@ public: void setEnabled(bool enabled) { _enabled = enabled; } /** - * Return a HardwareKey pointer for the given key state + * Return a HardwareInput pointer for the given key state */ - const HardwareKey *findHardwareKey(const KeyState& key); + const HardwareInput *findHardwareInput(const KeyState& key); Domain& getGlobalDomain() { return _globalDomain; } Domain& getGameDomain() { return _gameDomain; } @@ -183,7 +183,7 @@ private: Domain _globalDomain; Domain _gameDomain; - HardwareKeySet *_hardwareKeys; + HardwareInputSet *_hardwareInputs; void pushKeymap(Keymap *newMap, bool transparent, bool global); diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp index a869909196..dab295219a 100644 --- a/backends/keymapper/remap-dialog.cpp +++ b/backends/keymapper/remap-dialog.cpp @@ -244,7 +244,7 @@ void RemapDialog::clearMapping(uint i) { debug(3, "clear the mapping %u", i); _activeRemapAction = _currentActions[_topAction + i].action; - _activeRemapAction->mapKey(0); + _activeRemapAction->mapInput(0); _activeRemapAction->getParent()->saveMappings(); _changes = true; @@ -286,12 +286,12 @@ void RemapDialog::handleKeyDown(Common::KeyState state) { void RemapDialog::handleKeyUp(Common::KeyState state) { if (_activeRemapAction) { - const HardwareKey *hwkey = _keymapper->findHardwareKey(state); + const HardwareInput *hwInput = _keymapper->findHardwareInput(state); debug(4, "RemapDialog::handleKeyUp Key: %d, %d (%c), %x", state.keycode, state.ascii, (state.ascii ? state.ascii : ' '), state.flags); - if (hwkey) { - _activeRemapAction->mapKey(hwkey); + if (hwInput) { + _activeRemapAction->mapInput(hwInput); _activeRemapAction->getParent()->saveMappings(); _changes = true; stopRemapping(); @@ -325,7 +325,7 @@ void RemapDialog::loadKeymap() { // - all of the topmost keymap action // - all mapped actions that are reachable - List<const HardwareKey *> freeKeys(_keymapper->getHardwareKeys()); + List<const HardwareInput *> freeInputs(_keymapper->getHardwareInputs()); int topIndex = activeKeymaps.size() - 1; @@ -344,8 +344,8 @@ void RemapDialog::loadKeymap() { _currentActions.push_back(info); - if (act->getMappedKey()) - freeKeys.remove(act->getMappedKey()); + if (act->getMappedInput()) + freeInputs.remove(act->getMappedInput()); } // loop through remaining finding mappings for unmapped keys @@ -353,21 +353,21 @@ void RemapDialog::loadKeymap() { for (int i = topIndex - 1; i >= 0; --i) { Keymapper::MapRecord mr = activeKeymaps[i]; debug(3, "RemapDialog::loadKeymap keymap: %s", mr.keymap->getName().c_str()); - List<const HardwareKey *>::iterator keyIt = freeKeys.begin(); + List<const HardwareInput *>::iterator inputIt = freeInputs.begin(); + while (inputIt != freeInputs.end()) { - while (keyIt != freeKeys.end()) { - Action *act = mr.keymap->getMappedAction((*keyIt)->key); + Action *act = mr.keymap->getMappedAction((*inputIt)->key); if (act) { ActionInfo info = {act, true, act->description + " (" + mr.keymap->getName() + ")"}; _currentActions.push_back(info); - freeKeys.erase(keyIt++); + freeInputs.erase(inputIt); } else { - ++keyIt; + ++inputIt; } } - if (mr.transparent == false || freeKeys.empty()) + if (mr.transparent == false || freeInputs.empty()) break; } } @@ -420,10 +420,10 @@ void RemapDialog::refreshKeymap() { widg.actionText->setLabel(info.description); widg.actionText->setEnabled(!info.inherited); - const HardwareKey *mappedKey = info.action->getMappedKey(); + const HardwareInput *mappedInput = info.action->getMappedInput(); - if (mappedKey) - widg.keyButton->setLabel(mappedKey->description); + if (mappedInput) + widg.keyButton->setLabel(mappedInput->description); else widg.keyButton->setLabel("-"); |