MCPcopy Create free account
hub / github.com/TextGeneratorio/text-generator.io / dispatchKey

Function dispatchKey

static/libs/codemirror.js:7085–7101  ·  view source on GitHub ↗
(cm, name, e, handle)

Source from the content-addressed store, hash-verified

7083var stopSeq = new Delayed;
7084
7085function dispatchKey(cm, name, e, handle) {
7086 var seq = cm.state.keySeq;
7087 if (seq) {
7088 if (isModifierKey(name)) { return "handled" }
7089 if (/\'$/.test(name))
7090 { cm.state.keySeq = null; }
7091 else
7092 { stopSeq.set(50, function () {
7093 if (cm.state.keySeq == seq) {
7094 cm.state.keySeq = null;
7095 cm.display.input.reset();
7096 }
7097 }); }
7098 if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true }
7099 }
7100 return dispatchKeyInner(cm, name, e, handle)
7101}
7102
7103function dispatchKeyInner(cm, name, e, handle) {
7104 var result = lookupKeyForEditor(cm, name, handle);

Callers 3

handleKeyBindingFunction · 0.85
handleCharBindingFunction · 0.85
handleMappedButtonFunction · 0.85

Calls 2

isModifierKeyFunction · 0.85
dispatchKeyInnerFunction · 0.85

Tested by

no test coverage detected