diff options
author | Filippos Karapetis | 2011-12-30 00:08:31 +0200 |
---|---|---|
committer | Filippos Karapetis | 2011-12-30 00:09:10 +0200 |
commit | 410c9e0b30ae3f140bd55cfcfa05308d929da24e (patch) | |
tree | b53a1dd1e48e653c6c3f7b62d7faec4b07eb6e34 /backends/keymapper | |
parent | 5c9da2811964245c7bd26840a4710ff78ddaf334 (diff) | |
download | scummvm-rg350-410c9e0b30ae3f140bd55cfcfa05308d929da24e.tar.gz scummvm-rg350-410c9e0b30ae3f140bd55cfcfa05308d929da24e.tar.bz2 scummvm-rg350-410c9e0b30ae3f140bd55cfcfa05308d929da24e.zip |
KEYMAPPER: Fix broken implementation of findHardwareKey()
This fixes the keymapper dialog (at least on desktop platforms), but the
keymapper itself is still not working (tested with LoL)
Diffstat (limited to 'backends/keymapper')
-rw-r--r-- | backends/keymapper/hardware-key.h | 8 | ||||
-rw-r--r-- | backends/keymapper/keymap.cpp | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h index 32df042525..014e73a11e 100644 --- a/backends/keymapper/hardware-key.h +++ b/backends/keymapper/hardware-key.h @@ -97,8 +97,12 @@ public: List<const HardwareKey*>::const_iterator it; for (it = _keys.begin(); it != _keys.end(); it++) { - if ((*it)->key == keystate) - return (*it); + if ((*it)->key.keycode == keystate.keycode) { + // Only check for control/alt/shift modifiers, not for sticky + // modifiers like num lock/caps lock/scroll lock + if ((*it)->key.flags == (keystate.flags & 7)) + return (*it); + } } return 0; } diff --git a/backends/keymapper/keymap.cpp b/backends/keymapper/keymap.cpp index d2c9b9b572..d64b888702 100644 --- a/backends/keymapper/keymap.cpp +++ b/backends/keymapper/keymap.cpp @@ -145,7 +145,7 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) { const HardwareKey *hwKey = hwKeys->findHardwareKey(it->_value.c_str()); if (!hwKey) { - warning("HardwareKey with ID %s not known", it->_value.c_str()); + warning("HardwareKey with ID '%s' not known", it->_value.c_str()); _configDomain->erase(key); continue; } @@ -199,7 +199,7 @@ bool Keymap::isComplete(const HardwareKeySet *hwKeys) { // - if an action finds a key with required type but a parent action with // higher priority is using it, that key is never used void Keymap::automaticMapping(HardwareKeySet *hwKeys) { -#if 0 //disabling the broken automapper for now +#if 1 //disabling the broken automapper for now // Create copies of action and key lists. List<Action*> actions(_actions); List<const HardwareKey*> keys(hwKeys->getHardwareKeys()); |