MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / handleKeyBinding

Function handleKeyBinding

static/plugins/codemirror/codemirror.js:7220–7236  ·  view source on GitHub ↗
(cm, e)

Source from the content-addressed store, hash-verified

7218
7219 // Handle a key from the keydown event.
7220 function handleKeyBinding(cm, e) {
7221 var name = keyName(e, true);
7222 if (!name) { return false }
7223
7224 if (e.shiftKey && !cm.state.keySeq) {
7225 // First try to resolve full name (including 'Shift-'). Failing
7226 // that, see if there is a cursor-motion command (starting with
7227 // 'go') bound to the keyname without 'Shift-'.
7228 return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); })
7229 || dispatchKey(cm, name, e, function (b) {
7230 if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
7231 { return doHandleBinding(cm, b) }
7232 })
7233 } else {
7234 return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })
7235 }
7236 }
7237
7238 // Handle a key from the keypress event
7239 function handleCharBinding(cm, e, ch) {

Callers 2

onKeyDownFunction · 0.85
onKeyPressFunction · 0.85

Calls 3

keyNameFunction · 0.85
dispatchKeyFunction · 0.85
doHandleBindingFunction · 0.85

Tested by

no test coverage detected