MCPcopy Index your code
hub / github.com/csev/py4e / onKeyDown

Function onKeyDown

tools/pythonauto/static/codemirrorepl/codemirror.js:3018–3037  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

3016
3017 var lastStoppedKey = null;
3018 function onKeyDown(e) {
3019 var cm = this;
3020 ensureFocus(cm);
3021 if (signalDOMEvent(cm, e)) return;
3022 // IE does strange things with escape.
3023 if (ie_upto10 && e.keyCode == 27) e.returnValue = false;
3024 var code = e.keyCode;
3025 cm.display.shift = code == 16 || e.shiftKey;
3026 var handled = handleKeyBinding(cm, e);
3027 if (presto) {
3028 lastStoppedKey = handled ? code : null;
3029 // Opera has no cut event... we try to at least catch the key combo
3030 if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
3031 cm.replaceSelection("", null, "cut");
3032 }
3033
3034 // Turn mouse into crosshair when Alt is held on Mac.
3035 if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className))
3036 showCrossHair(cm);
3037 }
3038
3039 function showCrossHair(cm) {
3040 var lineDiv = cm.display.lineDiv;

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected