MCPcopy Index your code
hub / github.com/nwutils/nw-sample-apps / lookupKey

Function lookupKey

mini-code-edit/cm/lib/codemirror.js:2094–2114  ·  view source on GitHub ↗
(name, extraMap, map, handle, stop)

Source from the content-addressed store, hash-verified

2092 else return val;
2093 }
2094 function lookupKey(name, extraMap, map, handle, stop) {
2095 function lookup(map) {
2096 map = getKeyMap(map);
2097 var found = map[name];
2098 if (found != null && handle(found)) return true;
2099 if (map.nofallthrough) {
2100 if (stop) stop();
2101 return true;
2102 }
2103 var fallthrough = map.fallthrough;
2104 if (fallthrough == null) return false;
2105 if (Object.prototype.toString.call(fallthrough) != "[object Array]")
2106 return lookup(fallthrough);
2107 for (var i = 0, e = fallthrough.length; i < e; ++i) {
2108 if (lookup(fallthrough[i])) return true;
2109 }
2110 return false;
2111 }
2112 if (extraMap && lookup(extraMap)) return true;
2113 return lookup(map);
2114 }
2115 function isModifierKey(event) {
2116 var name = keyNames[e_prop(event, "keyCode")];
2117 return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod";

Callers 2

handleKeyBindingFunction · 0.85
handleCharBindingFunction · 0.85

Calls 1

lookupFunction · 0.85

Tested by

no test coverage detected