(e)
| 2158 | |
| 2159 | var lastStoppedKey = null; |
| 2160 | function onKeyDown(e) { |
| 2161 | var cm = this; |
| 2162 | ensureFocus(cm); |
| 2163 | if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; |
| 2164 | if (old_ie && e.keyCode == 27) e.returnValue = false; |
| 2165 | var code = e.keyCode; |
| 2166 | // IE does strange things with escape. |
| 2167 | cm.doc.sel.shift = code == 16 || e.shiftKey; |
| 2168 | // First give onKeyEvent option a chance to handle this. |
| 2169 | var handled = handleKeyBinding(cm, e); |
| 2170 | if (opera) { |
| 2171 | lastStoppedKey = handled ? code : null; |
| 2172 | // Opera has no cut event... we try to at least catch the key combo |
| 2173 | if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) |
| 2174 | cm.replaceSelection(""); |
| 2175 | } |
| 2176 | } |
| 2177 | |
| 2178 | function onKeyPress(e) { |
| 2179 | var cm = this; |
nothing calls this directly
no test coverage detected