MCPcopy
hub / github.com/witheve/Eve / dispatchKey

Function dispatchKey

src/codemirror.js:4129–4158  ·  view source on GitHub ↗
(cm, name, e, handle)

Source from the content-addressed store, hash-verified

4127
4128 var stopSeq = new Delayed;
4129 function dispatchKey(cm, name, e, handle) {
4130 var seq = cm.state.keySeq;
4131 if (seq) {
4132 if (isModifierKey(name)) return "handled";
4133 stopSeq.set(50, function() {
4134 if (cm.state.keySeq == seq) {
4135 cm.state.keySeq = null;
4136 cm.display.input.reset();
4137 }
4138 });
4139 name = seq + " " + name;
4140 }
4141 var result = lookupKeyForEditor(cm, name, handle);
4142
4143 if (result == "multi")
4144 cm.state.keySeq = name;
4145 if (result == "handled")
4146 signalLater(cm, "keyHandled", cm, name, e);
4147
4148 if (result == "handled" || result == "multi") {
4149 e_preventDefault(e);
4150 restartBlink(cm);
4151 }
4152
4153 if (seq && !result && /\'$/.test(name)) {
4154 e_preventDefault(e);
4155 return true;
4156 }
4157 return !!result;
4158 }
4159
4160 // Handle a key from the keydown event.
4161 function handleKeyBinding(cm, e) {

Callers 2

handleKeyBindingFunction · 0.85
handleCharBindingFunction · 0.85

Calls 5

lookupKeyForEditorFunction · 0.85
signalLaterFunction · 0.85
restartBlinkFunction · 0.85
resetMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected