MCPcopy Index your code
hub / github.com/csev/py4e / lookupKey

Function lookupKey

tools/pythonauto/static/codemirror/codemirror.js:3687–3710  ·  view source on GitHub ↗
(name, maps, handle)

Source from the content-addressed store, hash-verified

3685 }
3686
3687 function lookupKey(name, maps, handle) {
3688 function lookup(map) {
3689 map = getKeyMap(map);
3690 var found = map[name];
3691 if (found === false) return "stop";
3692 if (found != null && handle(found)) return true;
3693 if (map.nofallthrough) return "stop";
3694
3695 var fallthrough = map.fallthrough;
3696 if (fallthrough == null) return false;
3697 if (Object.prototype.toString.call(fallthrough) != "[object Array]")
3698 return lookup(fallthrough);
3699 for (var i = 0, e = fallthrough.length; i < e; ++i) {
3700 var done = lookup(fallthrough[i]);
3701 if (done) return done;
3702 }
3703 return false;
3704 }
3705
3706 for (var i = 0; i < maps.length; ++i) {
3707 var done = lookup(maps[i]);
3708 if (done) return done != "stop";
3709 }
3710 }
3711 function isModifierKey(event) {
3712 var name = keyNames[event.keyCode];
3713 return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod";

Callers 2

handleKeyBindingFunction · 0.70
handleCharBindingFunction · 0.70

Calls 1

lookupFunction · 0.70

Tested by

no test coverage detected