MCPcopy Create free account
hub / github.com/sql-js/sql.js / onKeyDown

Function onKeyDown

GUI/codemirror/lib/codemirror.js:3049–3068  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

3047
3048 var lastStoppedKey = null;
3049 function onKeyDown(e) {
3050 var cm = this;
3051 ensureFocus(cm);
3052 if (signalDOMEvent(cm, e)) return;
3053 // IE does strange things with escape.
3054 if (ie_upto10 && e.keyCode == 27) e.returnValue = false;
3055 var code = e.keyCode;
3056 cm.display.shift = code == 16 || e.shiftKey;
3057 var handled = handleKeyBinding(cm, e);
3058 if (presto) {
3059 lastStoppedKey = handled ? code : null;
3060 // Opera has no cut event... we try to at least catch the key combo
3061 if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
3062 cm.replaceSelection("", null, "cut");
3063 }
3064
3065 // Turn mouse into crosshair when Alt is held on Mac.
3066 if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className))
3067 showCrossHair(cm);
3068 }
3069
3070 function showCrossHair(cm) {
3071 var lineDiv = cm.display.lineDiv;

Callers

nothing calls this directly

Calls 4

ensureFocusFunction · 0.85
signalDOMEventFunction · 0.85
handleKeyBindingFunction · 0.85
showCrossHairFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…