diff options
author | Jody Northup | 2009-08-16 07:40:13 +0000 |
---|---|---|
committer | Jody Northup | 2009-08-16 07:40:13 +0000 |
commit | cbffcb609f752edcc3f086521c9e0c75b5ee4cc4 (patch) | |
tree | e212df62509a74330dd231bd652cc9ff583c5fb5 /backends/keymapper/keymap.cpp | |
parent | 43d57fd333afa54f4e85f30e2ef8231444988066 (diff) | |
download | scummvm-rg350-cbffcb609f752edcc3f086521c9e0c75b5ee4cc4.tar.gz scummvm-rg350-cbffcb609f752edcc3f086521c9e0c75b5ee4cc4.tar.bz2 scummvm-rg350-cbffcb609f752edcc3f086521c9e0c75b5ee4cc4.zip |
Replaced KeyStates with ActionKeys in the keymapper, removed SDL ASCII code mismatch workaround hacks, fixed the memory leaks I had previously created.
svn-id: r43430
Diffstat (limited to 'backends/keymapper/keymap.cpp')
-rw-r--r-- | backends/keymapper/keymap.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/backends/keymapper/keymap.cpp b/backends/keymapper/keymap.cpp index fe6f133254..9d8b6046cd 100644 --- a/backends/keymapper/keymap.cpp +++ b/backends/keymapper/keymap.cpp @@ -60,7 +60,7 @@ void Keymap::addAction(Action *action) { } void Keymap::registerMapping(Action *action, const HardwareKey *hwKey) { - HashMap<KeyState, Action*>::iterator it; + HashMap<ActionKey, Action*>::iterator it; it = _keymap.find(hwKey->key); @@ -105,8 +105,8 @@ const Action *Keymap::findAction(const char *id) const { return 0; } -Action *Keymap::getMappedAction(const KeyState& ks) const { - HashMap<KeyState, Action*>::iterator it; +Action *Keymap::getMappedAction(const ActionKey& ks) const { + HashMap<ActionKey, Action*>::iterator it; it = _keymap.find(ks); @@ -157,9 +157,7 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) { _configDomain->erase(key); continue; } - HardwareKey *mappedKey = new HardwareKey(*hwKey); - mappedKey->key.flags = modId; - ua->mapKey(mappedKey); + ua->mapKey(hwKey,modId); } } @@ -335,7 +333,7 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) { } } -Action *Keymap::getParentMappedAction(KeyState key) { +Action *Keymap::getParentMappedAction(const ActionKey &key) { if (_parent) { Action *act = _parent->getMappedAction(key); |