aboutsummaryrefslogtreecommitdiff
path: root/backends/keymapper/keymap.cpp
diff options
context:
space:
mode:
authorJody Northup2009-08-16 07:40:13 +0000
committerJody Northup2009-08-16 07:40:13 +0000
commitcbffcb609f752edcc3f086521c9e0c75b5ee4cc4 (patch)
treee212df62509a74330dd231bd652cc9ff583c5fb5 /backends/keymapper/keymap.cpp
parent43d57fd333afa54f4e85f30e2ef8231444988066 (diff)
downloadscummvm-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.cpp12
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);