Chromium Code Reviews| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 /** Construct a KeyEvent with [parent] as the event we're emulating. */ | 47 /** Construct a KeyEvent with [parent] as the event we're emulating. */ |
| 48 KeyEvent(KeyboardEvent parent) { | 48 KeyEvent(KeyboardEvent parent) { |
| 49 _parent = parent; | 49 _parent = parent; |
| 50 _shadowAltKey = _realAltKey; | 50 _shadowAltKey = _realAltKey; |
| 51 _shadowCharCode = _realCharCode; | 51 _shadowCharCode = _realCharCode; |
| 52 _shadowKeyCode = _realKeyCode; | 52 _shadowKeyCode = _realKeyCode; |
| 53 } | 53 } |
| 54 | 54 |
| 55 /** Accessor to provide a stream of KeyEvents on the desired target. */ | 55 /** Accessor to provide a stream of KeyEvents on the desired target. */ |
| 56 static EventStreamProvider<KeyEvent> keyDownEvent = | 56 static EventStreamProvider<KeyEvent> keyDownEvent = |
| 57 _KeyboardEventHandler('keydown'); | 57 new _KeyboardEventHandler('keydown'); |
|
Emily Fortuna
2013/03/25 20:32:59
This corresponding change in the dart2js_KeyEvent.
| |
| 58 /** Accessor to provide a stream of KeyEvents on the desired target. */ | 58 /** Accessor to provide a stream of KeyEvents on the desired target. */ |
| 59 static EventStreamProvider<KeyEvent> keyUpEvent = | 59 static EventStreamProvider<KeyEvent> keyUpEvent = |
| 60 _KeyboardEventHandler('keyup'); | 60 new _KeyboardEventHandler('keyup'); |
| 61 /** Accessor to provide a stream of KeyEvents on the desired target. */ | 61 /** Accessor to provide a stream of KeyEvents on the desired target. */ |
| 62 static EventStreamProvider<KeyEvent> keyPressEvent = | 62 static EventStreamProvider<KeyEvent> keyPressEvent = |
| 63 _KeyboardEventHandler('keypress'); | 63 new _KeyboardEventHandler('keypress'); |
| 64 | 64 |
| 65 /** True if the altGraphKey is pressed during this event. */ | 65 /** True if the altGraphKey is pressed during this event. */ |
| 66 bool get altGraphKey => _parent.altGraphKey; | 66 bool get altGraphKey => _parent.altGraphKey; |
| 67 bool get bubbles => _parent.bubbles; | 67 bool get bubbles => _parent.bubbles; |
| 68 /** True if this event can be cancelled. */ | 68 /** True if this event can be cancelled. */ |
| 69 bool get cancelable => _parent.cancelable; | 69 bool get cancelable => _parent.cancelable; |
| 70 bool get cancelBubble => _parent.cancelBubble; | 70 bool get cancelBubble => _parent.cancelBubble; |
| 71 void set cancelBubble(bool cancel) { | 71 void set cancelBubble(bool cancel) { |
| 72 _parent.cancelBubble = cancel; | 72 _parent.cancelBubble = cancel; |
| 73 } | 73 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 throw new UnsupportedError("keyIdentifier is unsupported."); | 123 throw new UnsupportedError("keyIdentifier is unsupported."); |
| 124 } | 124 } |
| 125 void $dom_initKeyboardEvent(String type, bool canBubble, bool cancelable, | 125 void $dom_initKeyboardEvent(String type, bool canBubble, bool cancelable, |
| 126 Window view, String keyIdentifier, int keyLocation, bool ctrlKey, | 126 Window view, String keyIdentifier, int keyLocation, bool ctrlKey, |
| 127 bool altKey, bool shiftKey, bool metaKey, | 127 bool altKey, bool shiftKey, bool metaKey, |
| 128 bool altGraphKey) { | 128 bool altGraphKey) { |
| 129 throw new UnsupportedError( | 129 throw new UnsupportedError( |
| 130 "Cannot initialize a KeyboardEvent from a KeyEvent."); | 130 "Cannot initialize a KeyboardEvent from a KeyEvent."); |
| 131 } | 131 } |
| 132 } | 132 } |
| OLD | NEW |