| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 EventTarget _currentTarget; | 49 EventTarget _currentTarget; |
| 50 | 50 |
| 51 /** | 51 /** |
| 52 * The value we want to use for this object's dispatch. Created here so it is | 52 * The value we want to use for this object's dispatch. Created here so it is |
| 53 * only invoked once. | 53 * only invoked once. |
| 54 */ | 54 */ |
| 55 static final _keyboardEventDispatchRecord = _makeRecord(); | 55 static final _keyboardEventDispatchRecord = _makeRecord(); |
| 56 | 56 |
| 57 /** Helper to statically create the dispatch record. */ | 57 /** Helper to statically create the dispatch record. */ |
| 58 static _makeRecord() { | 58 static _makeRecord() { |
| 59 var interceptor = findInterceptorForType(KeyboardEvent); | 59 var interceptor = JS_INTERCEPTOR_CONSTANT(KeyboardEvent); |
| 60 return makeLeafDispatchRecord(interceptor); | 60 return makeLeafDispatchRecord(interceptor); |
| 61 } | 61 } |
| 62 | 62 |
| 63 /** Construct a KeyEvent with [parent] as the event we're emulating. */ | 63 /** Construct a KeyEvent with [parent] as the event we're emulating. */ |
| 64 KeyEvent.wrap(KeyboardEvent parent): super(parent) { | 64 KeyEvent.wrap(KeyboardEvent parent): super(parent) { |
| 65 _parent = parent; | 65 _parent = parent; |
| 66 _shadowAltKey = _realAltKey; | 66 _shadowAltKey = _realAltKey; |
| 67 _shadowCharCode = _realCharCode; | 67 _shadowCharCode = _realCharCode; |
| 68 _shadowKeyCode = _realKeyCode; | 68 _shadowKeyCode = _realKeyCode; |
| 69 _currentTarget = _parent.currentTarget; | 69 _currentTarget = _parent.currentTarget; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 throw new UnsupportedError("keyIdentifier is unsupported."); | 204 throw new UnsupportedError("keyIdentifier is unsupported."); |
| 205 } | 205 } |
| 206 void _initKeyboardEvent(String type, bool canBubble, bool cancelable, | 206 void _initKeyboardEvent(String type, bool canBubble, bool cancelable, |
| 207 Window view, String keyIdentifier, int keyLocation, bool ctrlKey, | 207 Window view, String keyIdentifier, int keyLocation, bool ctrlKey, |
| 208 bool altKey, bool shiftKey, bool metaKey, | 208 bool altKey, bool shiftKey, bool metaKey, |
| 209 bool altGraphKey) { | 209 bool altGraphKey) { |
| 210 throw new UnsupportedError( | 210 throw new UnsupportedError( |
| 211 "Cannot initialize a KeyboardEvent from a KeyEvent."); | 211 "Cannot initialize a KeyboardEvent from a KeyEvent."); |
| 212 } | 212 } |
| 213 } | 213 } |
| OLD | NEW |