From cbffcb609f752edcc3f086521c9e0c75b5ee4cc4 Mon Sep 17 00:00:00 2001 From: Jody Northup Date: Sun, 16 Aug 2009 07:40:13 +0000 Subject: 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 --- backends/keymapper/keymap.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'backends/keymapper/keymap.cpp') 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::iterator it; + HashMap::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::iterator it; +Action *Keymap::getMappedAction(const ActionKey& ks) const { + HashMap::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); -- cgit v1.2.3