(e)
| 775 | |
| 776 | var lastStoppedKey = null, maybeTransition; |
| 777 | function onKeyDown(e) { |
| 778 | if (!focused) onFocus(); |
| 779 | if (ie && e.keyCode == 27) { e.returnValue = false; } |
| 780 | if (pollingFast) { if (readInput()) pollingFast = false; } |
| 781 | if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return; |
| 782 | var code = e_prop(e, "keyCode"); |
| 783 | // IE does strange things with escape. |
| 784 | setShift(code == 16 || e_prop(e, "shiftKey")); |
| 785 | // First give onKeyEvent option a chance to handle this. |
| 786 | var handled = handleKeyBinding(e); |
| 787 | if (window.opera) { |
| 788 | lastStoppedKey = handled ? code : null; |
| 789 | // Opera has no cut event... we try to at least catch the key combo |
| 790 | if (!handled && code == 88 && e_prop(e, mac ? "metaKey" : "ctrlKey")) |
| 791 | replaceSelection(""); |
| 792 | } |
| 793 | } |
| 794 | function onKeyPress(e) { |
| 795 | if (pollingFast) readInput(); |
| 796 | if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return; |
nothing calls this directly
no test coverage detected