| OLD | NEW |
| 1 /** | 1 /** |
| 2 * A custom KeyboardEvent that attempts to eliminate cross-browser | 2 * A custom KeyboardEvent that attempts to eliminate cross-browser |
| 3 * inconsistencies, and also provide both keyCode and charCode information | 3 * inconsistencies, and also provide both keyCode and charCode information |
| 4 * for all key events (when such information can be determined). | 4 * for all key events (when such information can be determined). |
| 5 * | 5 * |
| 6 * KeyEvent tries to provide a higher level, more polished keyboard event | 6 * KeyEvent tries to provide a higher level, more polished keyboard event |
| 7 * information on top of the "raw" [KeyboardEvent]. | 7 * information on top of the "raw" [KeyboardEvent]. |
| 8 * | 8 * |
| 9 * This class is very much a work in progress, and we'd love to get information | 9 * This class is very much a work in progress, and we'd love to get information |
| 10 * on how we can make this class work with as many international keyboards as | 10 * on how we can make this class work with as many international keyboards as |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 new _KeyboardEventHandler('keydown'); | 59 new _KeyboardEventHandler('keydown'); |
| 60 /** Accessor to provide a stream of KeyEvents on the desired target. */ | 60 /** Accessor to provide a stream of KeyEvents on the desired target. */ |
| 61 static EventStreamProvider<KeyEvent> keyUpEvent = | 61 static EventStreamProvider<KeyEvent> keyUpEvent = |
| 62 new _KeyboardEventHandler('keyup'); | 62 new _KeyboardEventHandler('keyup'); |
| 63 /** Accessor to provide a stream of KeyEvents on the desired target. */ | 63 /** Accessor to provide a stream of KeyEvents on the desired target. */ |
| 64 static EventStreamProvider<KeyEvent> keyPressEvent = | 64 static EventStreamProvider<KeyEvent> keyPressEvent = |
| 65 new _KeyboardEventHandler('keypress'); | 65 new _KeyboardEventHandler('keypress'); |
| 66 | 66 |
| 67 /** True if the altGraphKey is pressed during this event. */ | 67 /** True if the altGraphKey is pressed during this event. */ |
| 68 bool get altGraphKey => _parent.altGraphKey; | 68 bool get altGraphKey => _parent.altGraphKey; |
| 69 /** Accessor to the clipboardData available for this event. */ |
| 70 DataTransfer get clipboardData => _parent.clipboardData; |
| 69 /** True if the ctrl key is pressed during this event. */ | 71 /** True if the ctrl key is pressed during this event. */ |
| 70 bool get ctrlKey => _parent.ctrlKey; | 72 bool get ctrlKey => _parent.ctrlKey; |
| 71 int get detail => _parent.detail; | 73 int get detail => _parent.detail; |
| 72 /** | 74 /** |
| 73 * Accessor to the part of the keyboard that the key was pressed from (one of | 75 * Accessor to the part of the keyboard that the key was pressed from (one of |
| 74 * KeyLocation.STANDARD, KeyLocation.RIGHT, KeyLocation.LEFT, | 76 * KeyLocation.STANDARD, KeyLocation.RIGHT, KeyLocation.LEFT, |
| 75 * KeyLocation.NUMPAD, KeyLocation.MOBILE, KeyLocation.JOYSTICK). | 77 * KeyLocation.NUMPAD, KeyLocation.MOBILE, KeyLocation.JOYSTICK). |
| 76 */ | 78 */ |
| 77 int get keyLocation => _parent.keyLocation; | 79 int get keyLocation => _parent.keyLocation; |
| 78 Point get layer => _parent.layer; | 80 Point get layer => _parent.layer; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 94 throw new UnsupportedError("keyIdentifier is unsupported."); | 96 throw new UnsupportedError("keyIdentifier is unsupported."); |
| 95 } | 97 } |
| 96 void $dom_initKeyboardEvent(String type, bool canBubble, bool cancelable, | 98 void $dom_initKeyboardEvent(String type, bool canBubble, bool cancelable, |
| 97 Window view, String keyIdentifier, int keyLocation, bool ctrlKey, | 99 Window view, String keyIdentifier, int keyLocation, bool ctrlKey, |
| 98 bool altKey, bool shiftKey, bool metaKey, | 100 bool altKey, bool shiftKey, bool metaKey, |
| 99 bool altGraphKey) { | 101 bool altGraphKey) { |
| 100 throw new UnsupportedError( | 102 throw new UnsupportedError( |
| 101 "Cannot initialize a KeyboardEvent from a KeyEvent."); | 103 "Cannot initialize a KeyboardEvent from a KeyEvent."); |
| 102 } | 104 } |
| 103 } | 105 } |
| OLD | NEW |