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 |
32 /** The parent KeyboardEvent that this KeyEvent is wrapping and "fixing". */ | 39 /** The parent KeyboardEvent that this KeyEvent is wrapping and "fixing". */ |
33 KeyboardEvent _parent; | 40 KeyboardEvent _parent; |
34 | 41 |
35 /** The "fixed" value of whether the alt key is being pressed. */ | 42 /** The "fixed" value of whether the alt key is being pressed. */ |
36 bool _shadowAltKey; | 43 bool _shadowAltKey; |
37 | 44 |
38 /** Caculated value of what the estimated charCode is for this event. */ | 45 /** Caculated value of what the estimated charCode is for this event. */ |
39 int _shadowCharCode; | 46 int _shadowCharCode; |
40 | 47 |
41 /** Caculated value of what the estimated keyCode is for this event. */ | 48 /** Caculated value of what the estimated keyCode is for this event. */ |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 int get _pageX => throw new UnsupportedError('Not applicable to KeyEvent'); | 152 int get _pageX => throw new UnsupportedError('Not applicable to KeyEvent'); |
146 int get _pageY => throw new UnsupportedError('Not applicable to KeyEvent'); | 153 int get _pageY => throw new UnsupportedError('Not applicable to KeyEvent'); |
147 @Experimental() // untriaged | 154 @Experimental() // untriaged |
148 bool getModifierState(String keyArgument) => throw new UnimplementedError(); | 155 bool getModifierState(String keyArgument) => throw new UnimplementedError(); |
149 @Experimental() // untriaged | 156 @Experimental() // untriaged |
150 int get location => throw new UnimplementedError(); | 157 int get location => throw new UnimplementedError(); |
151 @Experimental() // untriaged | 158 @Experimental() // untriaged |
152 bool get repeat => throw new UnimplementedError(); | 159 bool get repeat => throw new UnimplementedError(); |
153 dynamic get _get_view => throw new UnimplementedError(); | 160 dynamic get _get_view => throw new UnimplementedError(); |
154 } | 161 } |
OLD | NEW |