MCPcopy Index your code
hub / github.com/DHTMLX/gantt / handleKeyBinding

Function handleKeyBinding

samples/common/codehighlight/codemirror.js:7176–7192  ·  view source on GitHub ↗
(cm, e)

Source from the content-addressed store, hash-verified

7174
7175 // Handle a key from the keydown event.
7176 function handleKeyBinding(cm, e) {
7177 var name = keyName(e, true);
7178 if (!name) { return false }
7179
7180 if (e.shiftKey && !cm.state.keySeq) {
7181 // First try to resolve full name (including 'Shift-'). Failing
7182 // that, see if there is a cursor-motion command (starting with
7183 // 'go') bound to the keyname without 'Shift-'.
7184 return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); })
7185 || dispatchKey(cm, name, e, function (b) {
7186 if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
7187 { return doHandleBinding(cm, b) }
7188 })
7189 } else {
7190 return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })
7191 }
7192 }
7193
7194 // Handle a key from the keypress event
7195 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