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

Function onKeyDown

tools/pythonauto/static/codemirror/codemirror.js:2160–2176  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

2158
2159 var lastStoppedKey = null;
2160 function onKeyDown(e) {
2161 var cm = this;
2162 ensureFocus(cm);
2163 if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;
2164 if (old_ie && e.keyCode == 27) e.returnValue = false;
2165 var code = e.keyCode;
2166 // IE does strange things with escape.
2167 cm.doc.sel.shift = code == 16 || e.shiftKey;
2168 // First give onKeyEvent option a chance to handle this.
2169 var handled = handleKeyBinding(cm, e);
2170 if (opera) {
2171 lastStoppedKey = handled ? code : null;
2172 // Opera has no cut event... we try to at least catch the key combo
2173 if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
2174 cm.replaceSelection("");
2175 }
2176 }
2177
2178 function onKeyPress(e) {
2179 var cm = this;

Callers

nothing calls this directly

Calls 4

ensureFocusFunction · 0.70
signalDOMEventFunction · 0.70
addStopFunction · 0.70
handleKeyBindingFunction · 0.70

Tested by

no test coverage detected