(e)
| 4184 | |
| 4185 | var lastStoppedKey = null; |
| 4186 | function onKeyDown(e) { |
| 4187 | var cm = this; |
| 4188 | cm.curOp.focus = activeElt(); |
| 4189 | if (signalDOMEvent(cm, e)) return; |
| 4190 | // IE does strange things with escape. |
| 4191 | if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false; |
| 4192 | var code = e.keyCode; |
| 4193 | cm.display.shift = code == 16 || e.shiftKey; |
| 4194 | var handled = handleKeyBinding(cm, e); |
| 4195 | if (presto) { |
| 4196 | lastStoppedKey = handled ? code : null; |
| 4197 | // Opera has no cut event... we try to at least catch the key combo |
| 4198 | if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) |
| 4199 | cm.replaceSelection("", null, "cut"); |
| 4200 | } |
| 4201 | |
| 4202 | // Turn mouse into crosshair when Alt is held on Mac. |
| 4203 | if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) |
| 4204 | showCrossHair(cm); |
| 4205 | } |
| 4206 | |
| 4207 | function showCrossHair(cm) { |
| 4208 | var lineDiv = cm.display.lineDiv; |
nothing calls this directly
no test coverage detected