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

Function handleKeyBinding

src/codemirror.js:4161–4177  ·  view source on GitHub ↗
(cm, e)

Source from the content-addressed store, hash-verified

4159
4160 // Handle a key from the keydown event.
4161 function handleKeyBinding(cm, e) {
4162 var name = keyName(e, true);
4163 if (!name) return false;
4164
4165 if (e.shiftKey && !cm.state.keySeq) {
4166 // First try to resolve full name (including 'Shift-'). Failing
4167 // that, see if there is a cursor-motion command (starting with
4168 // 'go') bound to the keyname without 'Shift-'.
4169 return dispatchKey(cm, "Shift-" + name, e, function(b) {return doHandleBinding(cm, b, true);})
4170 || dispatchKey(cm, name, e, function(b) {
4171 if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
4172 return doHandleBinding(cm, b);
4173 });
4174 } else {
4175 return dispatchKey(cm, name, e, function(b) { return doHandleBinding(cm, b); });
4176 }
4177 }
4178
4179 // Handle a key from the keypress event
4180 function handleCharBinding(cm, e, ch) {

Callers 2

onKeyDownFunction · 0.85
onKeyPressFunction · 0.85

Calls 3

dispatchKeyFunction · 0.85
doHandleBindingFunction · 0.85
testMethod · 0.45

Tested by

no test coverage detected