(e)
| 3997 | |
| 3998 | var lastStoppedKey = null; |
| 3999 | function onKeyDown(e) { |
| 4000 | var cm = this; |
| 4001 | ensureFocus(cm); |
| 4002 | if (signalDOMEvent(cm, e)) return; |
| 4003 | // IE does strange things with escape. |
| 4004 | if (ie && ie_version < 11 && e.keyCode == 27) e.returnValue = false; |
| 4005 | var code = e.keyCode; |
| 4006 | cm.display.shift = code == 16 || e.shiftKey; |
| 4007 | var handled = handleKeyBinding(cm, e); |
| 4008 | if (presto) { |
| 4009 | lastStoppedKey = handled ? code : null; |
| 4010 | // Opera has no cut event... we try to at least catch the key combo |
| 4011 | if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) |
| 4012 | cm.replaceSelection("", null, "cut"); |
| 4013 | } |
| 4014 | |
| 4015 | // Turn mouse into crosshair when Alt is held on Mac. |
| 4016 | if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) |
| 4017 | showCrossHair(cm); |
| 4018 | } |
| 4019 | |
| 4020 | function showCrossHair(cm) { |
| 4021 | var lineDiv = cm.display.lineDiv; |
nothing calls this directly
no test coverage detected