Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: tools/dom/src/dart2js_KeyEvent.dart

Issue 171203003: Improve KeyEvent documentation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/src/dartium_KeyEvent.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
10 * [KeyboardEvent]. To use KeyEvents, you need to create a stream and then add
11 * KeyEvents to the stream, rather than using the [EventTarget.dispatchEvent].
12 * Here's an example usage:
13 *
14 * // Initialize a stream for the KeyEvents:
15 * var stream = KeyEvent.keyPressEvent.forTarget(document.body);
16 * // Start listening to the stream of KeyEvents.
17 * stream.listen((keyEvent) =>
18 * window.console.log('KeyPress event detected ${keyEvent.charCode}'));
19 * ...
20 * // Add a new KeyEvent of someone pressing the 'A' key to the stream so
21 * // listeners can know a KeyEvent happened.
22 * stream.add(new KeyEvent('keypress', keyCode: 65, charCode: 97));
23 *
9 * 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
10 * 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
11 * possible. Bugs welcome! 26 * possible. Bugs welcome!
12 */ 27 */
13 @Experimental() 28 @Experimental()
14 class KeyEvent extends _WrappedEvent implements KeyboardEvent { 29 class KeyEvent extends _WrappedEvent implements KeyboardEvent {
15 /** The parent KeyboardEvent that this KeyEvent is wrapping and "fixing". */ 30 /** The parent KeyboardEvent that this KeyEvent is wrapping and "fixing". */
16 KeyboardEvent _parent; 31 KeyboardEvent _parent;
17 32
18 /** The "fixed" value of whether the alt key is being pressed. */ 33 /** The "fixed" value of whether the alt key is being pressed. */
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 int get _pageX => throw new UnsupportedError('Not applicable to KeyEvent'); 230 int get _pageX => throw new UnsupportedError('Not applicable to KeyEvent');
216 int get _pageY => throw new UnsupportedError('Not applicable to KeyEvent'); 231 int get _pageY => throw new UnsupportedError('Not applicable to KeyEvent');
217 @Experimental() // untriaged 232 @Experimental() // untriaged
218 bool getModifierState(String keyArgument) => throw new UnimplementedError(); 233 bool getModifierState(String keyArgument) => throw new UnimplementedError();
219 @Experimental() // untriaged 234 @Experimental() // untriaged
220 int get location => throw new UnimplementedError(); 235 int get location => throw new UnimplementedError();
221 @Experimental() // untriaged 236 @Experimental() // untriaged
222 bool get repeat => throw new UnimplementedError(); 237 bool get repeat => throw new UnimplementedError();
223 dynamic get _get_view => throw new UnimplementedError(); 238 dynamic get _get_view => throw new UnimplementedError();
224 } 239 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/src/dartium_KeyEvent.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698