Chromium Code Reviews| Index: sdk/lib/html/templates/html/dart2js/impl_KeyboardEvent.darttemplate |
| diff --git a/sdk/lib/html/templates/html/dart2js/impl_KeyboardEvent.darttemplate b/sdk/lib/html/templates/html/dart2js/impl_KeyboardEvent.darttemplate |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..90f67752aa97da5c8cbada882ac68cee8726ca67 |
| --- /dev/null |
| +++ b/sdk/lib/html/templates/html/dart2js/impl_KeyboardEvent.darttemplate |
| @@ -0,0 +1,37 @@ |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| + |
| +/// @domName KeyboardEvent; @docsEditable true |
| +class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| + |
| + factory $CLASSNAME(String type, Window view, |
| + [bool canBubble = true, bool cancelable = true, |
| + String keyIdentifier = null, int keyLocation = 1, bool ctrlKey = false, |
| + bool altKey = false, bool shiftKey = false, bool metaKey = false, |
| + bool altGraphKey = false]) { |
| + final e = document.$dom_createEvent("KeyboardEvent"); |
| + e.$dom_initKeyboardEvent(type, canBubble, cancelable, view, keyIdentifier, |
| + keyLocation, ctrlKey, altKey, shiftKey, metaKey, altGraphKey); |
| + return e; |
| + } |
| + |
| + /** @domName KeyboardEvent.initKeyboardEvent */ |
| + void $dom_initKeyboardEvent(String type, bool canBubble, bool cancelable, |
| + LocalWindow view, String keyIdentifier, int keyLocation, bool ctrlKey, |
| + bool altKey, bool shiftKey, bool metaKey, bool altGraphKey) { |
| + var function = JS('dynamic', '#.initKeyboardEvent || #.initKeyEvent', this, |
|
blois
2012/11/29 00:03:12
Under what cases is it initKeyboardEvent vs initKe
Emily Fortuna
2012/11/29 01:10:37
initKeyboardEvent == webkit browsers.
initKeyEvent
blois
2012/11/29 17:06:34
Can you add a brief comment for that?
Emily Fortuna
2012/11/29 19:19:49
Done.
|
| + this); |
| + JS('void', '#(#, #, #, #, #, #, #, #, #, #, #)', function, type, |
| + canBubble, cancelable, view, keyIdentifier, keyLocation, ctrlKey, |
| + altKey, shiftKey, metaKey, altGraphKey); |
| + } |
| + |
| + /** @domName KeyboardEvent.keyCode */ |
| + int get keyCode => $dom_keyCode; |
|
blois
2012/11/29 00:03:12
Why hide then re-expose it?
Emily Fortuna
2012/11/29 01:10:37
At your request from way back when, I hid it on UI
blois
2012/11/29 17:06:34
Oh yeah :)
|
| + |
| + /** @domName KeyboardEvent.charCode */ |
| + int get charCode => $dom_charCode; |
| +$!MEMBERS |
| +} |