OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. | 2 * Copyright (C) 2006 Apple Computer, Inc. |
3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 */ | 19 */ |
20 | 20 |
| 21 // https://w3c.github.io/uievents/#interface-KeyboardEvent |
| 22 |
21 [ | 23 [ |
22 Constructor(DOMString type, optional KeyboardEventInit eventInitDict), | 24 Constructor(DOMString type, optional KeyboardEventInit eventInitDict), |
23 ConstructorCallWith=ScriptState, | 25 ConstructorCallWith=ScriptState, |
24 ] interface KeyboardEvent : UIEvent { | 26 ] interface KeyboardEvent : UIEvent { |
| 27 // KeyLocationCode |
25 const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00; | 28 const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00; |
26 const unsigned long DOM_KEY_LOCATION_LEFT = 0x01; | 29 const unsigned long DOM_KEY_LOCATION_LEFT = 0x01; |
27 const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02; | 30 const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02; |
28 const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03; | 31 const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03; |
29 | 32 [RuntimeEnabled=KeyboardEventKey] readonly attribute DOMString key; |
30 [RuntimeEnabled=KeyboardEventCode] readonly attribute DOMString code; | 33 [RuntimeEnabled=KeyboardEventCode] readonly attribute DOMString code; |
31 [RuntimeEnabled=KeyboardEventKey] readonly attribute DOMString key; | |
32 readonly attribute DOMString keyIdentifier; | |
33 readonly attribute unsigned long location; | 34 readonly attribute unsigned long location; |
34 [ImplementedAs=location, DeprecateAs=KeyboardEventKeyLocation] readonly attr
ibute unsigned long keyLocation; // Deprecated. | |
35 readonly attribute boolean ctrlKey; | 35 readonly attribute boolean ctrlKey; |
36 readonly attribute boolean shiftKey; | 36 readonly attribute boolean shiftKey; |
37 readonly attribute boolean altKey; | 37 readonly attribute boolean altKey; |
38 readonly attribute boolean metaKey; | 38 readonly attribute boolean metaKey; |
39 readonly attribute boolean repeat; | 39 readonly attribute boolean repeat; |
| 40 // TODO(philipj): readonly attribute boolean isComposing; |
| 41 boolean getModifierState(DOMString keyArg); |
40 | 42 |
41 boolean getModifierState(DOMString keyArgument); | 43 // https://w3c.github.io/uievents/#idl-interface-KeyboardEvent-initializers |
42 | 44 // FIXME: this does not match the version in the spec. |
43 // FIXME: this does not match the version in the DOM spec. | |
44 [CallWith=ScriptState] void initKeyboardEvent([Default=Undefined] optional D
OMString type, | 45 [CallWith=ScriptState] void initKeyboardEvent([Default=Undefined] optional D
OMString type, |
45 [Default=Undefined] optional boolean canBubble, | 46 [Default=Undefined] optional boolean canBubble, |
46 [Default=Undefined] optional boolean cancelable, | 47 [Default=Undefined] optional boolean cancelable, |
47 [Default=Undefined] optional Window view, | 48 [Default=Undefined] optional Window view, |
48 [Default=Undefined] optional DOMString keyIdentifier, | 49 [Default=Undefined] optional DOMString keyIdentifier, |
49 [Default=Undefined] optional unsigned long location, | 50 [Default=Undefined] optional unsigned long location, |
50 [Default=Undefined] optional boolean ctrlKey, | 51 [Default=Undefined] optional boolean ctrlKey, |
51 [Default=Undefined] optional boolean altKey, | 52 [Default=Undefined] optional boolean altKey, |
52 [Default=Undefined] optional boolean shiftKey, | 53 [Default=Undefined] optional boolean shiftKey, |
53 [Default=Undefined] optional boolean metaKey); | 54 [Default=Undefined] optional boolean metaKey); |
54 | 55 |
| 56 // https://w3c.github.io/uievents/#KeyboardEvent-supplemental-interface |
55 readonly attribute long charCode; | 57 readonly attribute long charCode; |
56 readonly attribute long keyCode; | 58 readonly attribute long keyCode; |
57 readonly attribute long which; | 59 readonly attribute long which; |
| 60 |
| 61 // Non-standard APIs |
| 62 [Measure] readonly attribute DOMString keyIdentifier; |
| 63 [ImplementedAs=location, DeprecateAs=KeyboardEventKeyLocation] readonly attr
ibute unsigned long keyLocation; |
58 }; | 64 }; |
OLD | NEW |