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

Function onKeyPress

tools/pythonauto/static/codemirrorepl/codemirrorepl.js:794–807  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

792 }
793 }
794 function onKeyPress(e) {
795 if (pollingFast) readInput();
796 if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return;
797 var keyCode = e_prop(e, "keyCode"), charCode = e_prop(e, "charCode");
798 if (window.opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;}
799 if (((window.opera && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(e)) return;
800 var ch = String.fromCharCode(charCode == null ? keyCode : charCode);
801 if (options.electricChars && mode.electricChars && options.smartIndent && !options.readOnly) {
802 if (mode.electricChars.indexOf(ch) > -1)
803 setTimeout(operation(function() {indentLine(sel.to.line, "smart");}), 75);
804 }
805 if (handleCharBinding(e, ch)) return;
806 fastPoll();
807 }
808 function onKeyUp(e) {
809 if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return;
810 if (e_prop(e, "keyCode") == 16) shiftSelecting = null;

Callers

nothing calls this directly

Calls 9

e_propFunction · 0.85
readInputFunction · 0.70
addStopFunction · 0.70
e_preventDefaultFunction · 0.70
handleKeyBindingFunction · 0.70
operationFunction · 0.70
indentLineFunction · 0.70
handleCharBindingFunction · 0.70
fastPollFunction · 0.70

Tested by

no test coverage detected