KEYMAPPER: Rename inherit flag to transparent

Less confusing
This commit is contained in:
Tarek Soliman 2012-01-07 21:10:05 -06:00
parent 73160e54b4
commit 82e0900678
3 changed files with 14 additions and 14 deletions

View file

@ -143,7 +143,7 @@ Keymap *Keymapper::getKeymap(const String& name, bool *globalReturn) {
return keymap; return keymap;
} }
bool Keymapper::pushKeymap(const String& name, bool inherit) { bool Keymapper::pushKeymap(const String& name, bool transparent) {
bool global; bool global;
Keymap *newMap = getKeymap(name, &global); Keymap *newMap = getKeymap(name, &global);
@ -152,13 +152,13 @@ bool Keymapper::pushKeymap(const String& name, bool inherit) {
return false; return false;
} }
pushKeymap(newMap, inherit, global); pushKeymap(newMap, transparent, global);
return true; return true;
} }
void Keymapper::pushKeymap(Keymap *newMap, bool inherit, bool global) { void Keymapper::pushKeymap(Keymap *newMap, bool transparent, bool global) {
MapRecord mr = {newMap, inherit, global}; MapRecord mr = {newMap, transparent, global};
_activeMaps.push(mr); _activeMaps.push(mr);
} }
@ -198,7 +198,7 @@ bool Keymapper::mapKey(const KeyState& key, bool keyDown) {
debug(5, "Keymapper::mapKey keymap: %s", mr.keymap->getName().c_str()); debug(5, "Keymapper::mapKey keymap: %s", mr.keymap->getName().c_str());
action = mr.keymap->getMappedAction(key); action = mr.keymap->getMappedAction(key);
if (action || !mr.inherit) if (action || !mr.transparent)
break; break;
} }

View file

@ -43,7 +43,7 @@ public:
struct MapRecord { struct MapRecord {
Keymap* keymap; Keymap* keymap;
bool inherit; bool transparent;
bool global; bool global;
}; };
@ -122,11 +122,11 @@ public:
* Push a new keymap to the top of the active stack, activating * Push a new keymap to the top of the active stack, activating
* it for use. * it for use.
* @param name name of the keymap to push * @param name name of the keymap to push
* @param inherit if true keymapper will iterate down the * @param transparent if true keymapper will iterate down the
* stack if it cannot find a key in the new map * stack if it cannot find a key in the new map
* @return true if succesful * @return true if succesful
*/ */
bool pushKeymap(const String& name, bool inherit = false); bool pushKeymap(const String& name, bool transparent = false);
/** /**
* Pop the top keymap off the active stack. * Pop the top keymap off the active stack.
@ -182,7 +182,7 @@ private:
HardwareKeySet *_hardwareKeys; HardwareKeySet *_hardwareKeys;
void pushKeymap(Keymap *newMap, bool inherit, bool global); void pushKeymap(Keymap *newMap, bool transparent, bool global);
Action *getAction(const KeyState& key); Action *getAction(const KeyState& key);
void executeAction(const Action *act, bool keyDown); void executeAction(const Action *act, bool keyDown);

View file

@ -327,7 +327,7 @@ void RemapDialog::loadKeymap() {
} }
// loop through remaining finding mappings for unmapped keys // loop through remaining finding mappings for unmapped keys
if (top.inherit && topIndex >= 0) { if (top.transparent && topIndex >= 0) {
for (int i = topIndex - 1; i >= 0; --i) { for (int i = topIndex - 1; i >= 0; --i) {
Keymapper::MapRecord mr = activeKeymaps[i]; Keymapper::MapRecord mr = activeKeymaps[i];
debug(3, "RemapDialog::loadKeymap keymap: %s", mr.keymap->getName().c_str()); debug(3, "RemapDialog::loadKeymap keymap: %s", mr.keymap->getName().c_str());
@ -345,7 +345,7 @@ void RemapDialog::loadKeymap() {
} }
} }
if (mr.inherit == false || freeKeys.empty()) if (mr.transparent == false || freeKeys.empty())
break; break;
} }
} }