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

Function onKeyDown

samples/common/codehighlight/codemirror.js:7200–7222  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

7198
7199 var lastStoppedKey = null;
7200 function onKeyDown(e) {
7201 var cm = this;
7202 if (e.target && e.target != cm.display.input.getField()) { return }
7203 cm.curOp.focus = activeElt();
7204 if (signalDOMEvent(cm, e)) { return }
7205 // IE does strange things with escape.
7206 if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }
7207 var code = e.keyCode;
7208 cm.display.shift = code == 16 || e.shiftKey;
7209 var handled = handleKeyBinding(cm, e);
7210 if (presto) {
7211 lastStoppedKey = handled ? code : null;
7212 // Opera has no cut event... we try to at least catch the key combo
7213 if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
7214 { cm.replaceSelection("", null, "cut"); }
7215 }
7216 if (gecko && !mac && !handled && code == 46 && e.shiftKey && !e.ctrlKey && document.execCommand)
7217 { document.execCommand("cut"); }
7218
7219 // Turn mouse into crosshair when Alt is held on Mac.
7220 if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className))
7221 { showCrossHair(cm); }
7222 }
7223
7224 function showCrossHair(cm) {
7225 var lineDiv = cm.display.lineDiv;

Callers

nothing calls this directly

Calls 4

activeEltFunction · 0.85
signalDOMEventFunction · 0.85
handleKeyBindingFunction · 0.85
showCrossHairFunction · 0.85

Tested by

no test coverage detected