(e)
| 1925 | |
| 1926 | var lastStoppedKey = null; |
| 1927 | function onKeyDown(e) { |
| 1928 | var cm = this; |
| 1929 | if (!cm.state.focused) onFocus(cm); |
| 1930 | if (ie && e.keyCode == 27) { e.returnValue = false; } |
| 1931 | if (cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return; |
| 1932 | var code = e.keyCode; |
| 1933 | // IE does strange things with escape. |
| 1934 | cm.doc.sel.shift = code == 16 || e.shiftKey; |
| 1935 | // First give onKeyEvent option a chance to handle this. |
| 1936 | var handled = handleKeyBinding(cm, e); |
| 1937 | if (opera) { |
| 1938 | lastStoppedKey = handled ? code : null; |
| 1939 | // Opera has no cut event... we try to at least catch the key combo |
| 1940 | if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) |
| 1941 | cm.replaceSelection(""); |
| 1942 | } |
| 1943 | } |
| 1944 | |
| 1945 | function onKeyPress(e) { |
| 1946 | var cm = this; |
nothing calls this directly
no test coverage detected