MCPcopy Create free account
hub / github.com/TextGeneratorio/text-generator.io / onKeyPress

Function onKeyPress

static/libs/codemirror.js:7185–7196  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

7183}
7184
7185function onKeyPress(e) {
7186 var cm = this;
7187 if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }
7188 var keyCode = e.keyCode, charCode = e.charCode;
7189 if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}
7190 if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }
7191 var ch = String.fromCharCode(charCode == null ? keyCode : charCode);
7192 // Some browsers fire keypress events for backspace
7193 if (ch == "\x08") { return }
7194 if (handleCharBinding(cm, e, ch)) { return }
7195 cm.display.input.onKeyPress(e);
7196}
7197
7198var DOUBLECLICK_DELAY = 400;
7199

Callers

nothing calls this directly

Calls 5

eventInWidgetFunction · 0.85
signalDOMEventFunction · 0.85
e_preventDefaultFunction · 0.85
handleKeyBindingFunction · 0.85
handleCharBindingFunction · 0.85

Tested by

no test coverage detected