MCPcopy Create free account
hub / github.com/breck7/scroll / lookupKey

Function lookupKey

external/.scrollLibs.js:9229–9253  ·  view source on GitHub ↗
(key, map$$1, handle, context)

Source from the content-addressed store, hash-verified

9227 }
9228
9229 function lookupKey(key, map$$1, handle, context) {
9230 map$$1 = getKeyMap(map$$1)
9231 var found = map$$1.call ? map$$1.call(key, context) : map$$1[key]
9232 if (found === false) {
9233 return "nothing"
9234 }
9235 if (found === "...") {
9236 return "multi"
9237 }
9238 if (found != null && handle(found)) {
9239 return "handled"
9240 }
9241
9242 if (map$$1.fallthrough) {
9243 if (Object.prototype.toString.call(map$$1.fallthrough) != "[object Array]") {
9244 return lookupKey(key, map$$1.fallthrough, handle, context)
9245 }
9246 for (var i = 0; i < map$$1.fallthrough.length; i++) {
9247 var result = lookupKey(key, map$$1.fallthrough[i], handle, context)
9248 if (result) {
9249 return result
9250 }
9251 }
9252 }
9253 }
9254
9255 // Modifier key presses don't count as 'real' key presses for the
9256 // purpose of keymap fallthrough.

Callers 1

lookupKeyForEditorFunction · 0.85

Calls 1

getKeyMapFunction · 0.85

Tested by

no test coverage detected