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

Function dispatchKey

external/.scrollLibs.js:9786–9807  ·  view source on GitHub ↗
(cm, name, e, handle)

Source from the content-addressed store, hash-verified

9784 var stopSeq = new Delayed()
9785
9786 function dispatchKey(cm, name, e, handle) {
9787 var seq = cm.state.keySeq
9788 if (seq) {
9789 if (isModifierKey(name)) {
9790 return "handled"
9791 }
9792 if (/\'$/.test(name)) {
9793 cm.state.keySeq = null
9794 } else {
9795 stopSeq.set(50, function () {
9796 if (cm.state.keySeq == seq) {
9797 cm.state.keySeq = null
9798 cm.display.input.reset()
9799 }
9800 })
9801 }
9802 if (dispatchKeyInner(cm, seq + " " + name, e, handle)) {
9803 return true
9804 }
9805 }
9806 return dispatchKeyInner(cm, name, e, handle)
9807 }
9808
9809 function dispatchKeyInner(cm, name, e, handle) {
9810 var result = lookupKeyForEditor(cm, name, handle)

Callers 3

handleKeyBindingFunction · 0.85
handleCharBindingFunction · 0.85
handleMappedButtonFunction · 0.85

Calls 3

isModifierKeyFunction · 0.85
dispatchKeyInnerFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected