MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / dispatchKey

Function dispatchKey

lib/web/CodeMirror/src/edit/key_events.js:48–64  ·  view source on GitHub ↗
(cm, name, e, handle)

Source from the content-addressed store, hash-verified

46let stopSeq = new Delayed
47
48export function dispatchKey(cm, name, e, handle) {
49 let seq = cm.state.keySeq
50 if (seq) {
51 if (isModifierKey(name)) return "handled"
52 if (/\'$/.test(name))
53 cm.state.keySeq = null
54 else
55 stopSeq.set(50, () => {
56 if (cm.state.keySeq == seq) {
57 cm.state.keySeq = null
58 cm.display.input.reset()
59 }
60 })
61 if (dispatchKeyInner(cm, seq + " " + name, e, handle)) return true
62 }
63 return dispatchKeyInner(cm, name, e, handle)
64}
65
66function dispatchKeyInner(cm, name, e, handle) {
67 let result = lookupKeyForEditor(cm, name, handle)

Callers 3

handleMappedButtonFunction · 0.90
handleKeyBindingFunction · 0.70
handleCharBindingFunction · 0.70

Calls 5

isModifierKeyFunction · 0.90
dispatchKeyInnerFunction · 0.70
setMethod · 0.65
resetMethod · 0.65
testMethod · 0.45

Tested by

no test coverage detected