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

Function lookupKey

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:2294–2314  ·  view source on GitHub ↗
(name, extraMap, map, handle, stop)

Source from the content-addressed store, hash-verified

2292 else return val;
2293 }
2294 function lookupKey(name, extraMap, map, handle, stop) {
2295 function lookup(map) {
2296 map = getKeyMap(map);
2297 var found = map[name];
2298 if (found != null && handle(found)) return true;
2299 if (map.nofallthrough) {
2300 if (stop) stop();
2301 return true;
2302 }
2303 var fallthrough = map.fallthrough;
2304 if (fallthrough == null) return false;
2305 if (Object.prototype.toString.call(fallthrough) != "[object Array]")
2306 return lookup(fallthrough);
2307 for (var i = 0, e = fallthrough.length; i < e; ++i) {
2308 if (lookup(fallthrough[i])) return true;
2309 }
2310 return false;
2311 }
2312 if (extraMap && lookup(extraMap)) return true;
2313 return lookup(map);
2314 }
2315 function isModifierKey(event) {
2316 var name = keyNames[e_prop(event, "keyCode")];
2317 return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod";

Callers 4

handleKeyBindingFunction · 0.70
handleCharBindingFunction · 0.70
handleKeyBindingFunction · 0.70
handleCharBindingFunction · 0.70

Calls 1

lookupFunction · 0.70

Tested by

no test coverage detected