| 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 * The mechanics of using KeyEvents is a little different from the underlying | 9 * The mechanics of using KeyEvents is a little different from the underlying |
| 10 * [KeyboardEvent]. To use KeyEvents, you need to create a stream and then add | 10 * [KeyboardEvent]. To use KeyEvents, you need to create a stream and then add |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * stream.add(new KeyEvent('keypress', keyCode: 65, charCode: 97)); | 22 * stream.add(new KeyEvent('keypress', keyCode: 65, charCode: 97)); |
| 23 * | 23 * |
| 24 * This class is very much a work in progress, and we'd love to get information | 24 * This class is very much a work in progress, and we'd love to get information |
| 25 * on how we can make this class work with as many international keyboards as | 25 * on how we can make this class work with as many international keyboards as |
| 26 * possible. Bugs welcome! | 26 * possible. Bugs welcome! |
| 27 */ | 27 */ |
| 28 part of html; | 28 part of html; |
| 29 | 29 |
| 30 @Experimental() | 30 @Experimental() |
| 31 class KeyEvent extends _WrappedEvent implements KeyboardEvent { | 31 class KeyEvent extends _WrappedEvent implements KeyboardEvent { |
| 32 /** Needed because KeyboardEvent is implements. | |
| 33 * TODO(terry): Consider making blink_jsObject private (add underscore) for | |
| 34 * all blink_jsObject. Then needed private wrap/unwrap_jso | |
| 35 * functions that delegate to a public wrap/unwrap_jso. | |
| 36 */ | |
| 37 js.JsObject blink_jsObject; | |
| 38 | |
| 39 /** The parent KeyboardEvent that this KeyEvent is wrapping and "fixing". */ | 32 /** The parent KeyboardEvent that this KeyEvent is wrapping and "fixing". */ |
| 40 KeyboardEvent _parent; | 33 KeyboardEvent _parent; |
| 41 | 34 |
| 42 /** The "fixed" value of whether the alt key is being pressed. */ | 35 /** The "fixed" value of whether the alt key is being pressed. */ |
| 43 bool _shadowAltKey; | 36 bool _shadowAltKey; |
| 44 | 37 |
| 45 /** Caculated value of what the estimated charCode is for this event. */ | 38 /** Caculated value of what the estimated charCode is for this event. */ |
| 46 int _shadowCharCode; | 39 int _shadowCharCode; |
| 47 | 40 |
| 48 /** Caculated value of what the estimated keyCode is for this event. */ | 41 /** Caculated value of what the estimated keyCode is for this event. */ |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 int get _pageX => throw new UnsupportedError('Not applicable to KeyEvent'); | 145 int get _pageX => throw new UnsupportedError('Not applicable to KeyEvent'); |
| 153 int get _pageY => throw new UnsupportedError('Not applicable to KeyEvent'); | 146 int get _pageY => throw new UnsupportedError('Not applicable to KeyEvent'); |
| 154 @Experimental() // untriaged | 147 @Experimental() // untriaged |
| 155 bool getModifierState(String keyArgument) => throw new UnimplementedError(); | 148 bool getModifierState(String keyArgument) => throw new UnimplementedError(); |
| 156 @Experimental() // untriaged | 149 @Experimental() // untriaged |
| 157 int get location => throw new UnimplementedError(); | 150 int get location => throw new UnimplementedError(); |
| 158 @Experimental() // untriaged | 151 @Experimental() // untriaged |
| 159 bool get repeat => throw new UnimplementedError(); | 152 bool get repeat => throw new UnimplementedError(); |
| 160 dynamic get _get_view => throw new UnimplementedError(); | 153 dynamic get _get_view => throw new UnimplementedError(); |
| 161 } | 154 } |
| OLD | NEW |