MCPcopy Create free account
hub / github.com/breck7/scroll / onKeyPress

Function onKeyPress

external/.scrollLibs.js:9912–9936  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

9910 }
9911
9912 function onKeyPress(e) {
9913 var cm = this
9914 if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || (e.ctrlKey && !e.altKey) || (mac && e.metaKey)) {
9915 return
9916 }
9917 var keyCode = e.keyCode,
9918 charCode = e.charCode
9919 if (presto && keyCode == lastStoppedKey) {
9920 lastStoppedKey = null
9921 e_preventDefault(e)
9922 return
9923 }
9924 if (presto && (!e.which || e.which < 10) && handleKeyBinding(cm, e)) {
9925 return
9926 }
9927 var ch = String.fromCharCode(charCode == null ? keyCode : charCode)
9928 // Some browsers fire keypress events for backspace
9929 if (ch == "\x08") {
9930 return
9931 }
9932 if (handleCharBinding(cm, e, ch)) {
9933 return
9934 }
9935 cm.display.input.onKeyPress(e)
9936 }
9937
9938 var DOUBLECLICK_DELAY = 400
9939

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