Chromium Code Reviews| Index: tools/dom/src/dart2js_KeyEvent.dart |
| diff --git a/tools/dom/src/dart2js_KeyEvent.dart b/tools/dom/src/dart2js_KeyEvent.dart |
| index 5686b61f1270d58aefb17e3b555e06d0b34a84dd..5a0a133a36aaa77cb4d4f9e26834d4dc57e1ea5e 100644 |
| --- a/tools/dom/src/dart2js_KeyEvent.dart |
| +++ b/tools/dom/src/dart2js_KeyEvent.dart |
| @@ -3,6 +3,9 @@ |
| * inconsistencies, and also provide both keyCode and charCode information |
| * for all key events (when such information can be determined). |
| * |
| + * KeyEvent tries to provide a higher level, more polished keyboard event |
| + * information on top of the "raw" [KeyboardEvent]. |
| + * |
| * This class is very much a work in progress, and we'd love to get information |
| * on how we can make this class work with as many international keyboards as |
| * possible. Bugs welcome! |
| @@ -41,7 +44,7 @@ class KeyEvent implements KeyboardEvent { |
| /** Accessor to the underlying altKey value is the parent event. */ |
| bool get _realAltKey => JS('int', '#.altKey', _parent); |
| - /** Construct a KeyEvent with [parent] as event we're emulating. */ |
| + /** Construct a KeyEvent with [parent] as the event we're emulating. */ |
| KeyEvent(KeyboardEvent parent) { |
| _parent = parent; |
| _shadowAltKey = _realAltKey; |
| @@ -49,6 +52,18 @@ class KeyEvent implements KeyboardEvent { |
| _shadowKeyCode = _realKeyCode; |
| } |
| + // TODO(efortuna): If KeyEvent is sufficiently successful that we want to make |
| + // it the default keyboard event handling, move these methods over to Element. |
|
Andrei Mouravski
2013/03/22 19:12:33
Create a bug tracking this and add it to the code.
|
| + /** Accessor to provide a stream of KeyEvents on the desired target. */ |
| + static EventStreamProvider<KeyEvent> keyDownEvent = |
| + new _KeyboardEventHandler('keydown'); |
| + /** Accessor to provide a stream of KeyEvents on the desired target. */ |
| + static EventStreamProvider<KeyEvent> keyUpEvent = |
| + new _KeyboardEventHandler('keyup'); |
| + /** Accessor to provide a stream of KeyEvents on the desired target. */ |
| + static EventStreamProvider<KeyEvent> keyPressEvent = |
| + new _KeyboardEventHandler('keypress'); |
| + |
| /** True if the altGraphKey is pressed during this event. */ |
| bool get altGraphKey => _parent.altGraphKey; |
| bool get bubbles => _parent.bubbles; |