|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
4 * You can obtain one at http://mozilla.org/MPL/2.0/. |
|
5 */ |
|
6 |
|
7 interface WindowProxy; |
|
8 |
|
9 [Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)] |
|
10 interface KeyboardEvent : UIEvent |
|
11 { |
|
12 readonly attribute unsigned long charCode; |
|
13 readonly attribute unsigned long keyCode; |
|
14 |
|
15 readonly attribute boolean altKey; |
|
16 readonly attribute boolean ctrlKey; |
|
17 readonly attribute boolean shiftKey; |
|
18 readonly attribute boolean metaKey; |
|
19 |
|
20 boolean getModifierState(DOMString key); |
|
21 |
|
22 const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00; |
|
23 const unsigned long DOM_KEY_LOCATION_LEFT = 0x01; |
|
24 const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02; |
|
25 const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03; |
|
26 const unsigned long DOM_KEY_LOCATION_MOBILE = 0x04; |
|
27 const unsigned long DOM_KEY_LOCATION_JOYSTICK = 0x05; |
|
28 |
|
29 readonly attribute unsigned long location; |
|
30 readonly attribute boolean repeat; |
|
31 readonly attribute boolean isComposing; |
|
32 |
|
33 readonly attribute DOMString key; |
|
34 }; |
|
35 |
|
36 dictionary KeyboardEventInit : UIEventInit |
|
37 { |
|
38 DOMString key = ""; |
|
39 unsigned long location = 0; |
|
40 boolean ctrlKey = false; |
|
41 boolean shiftKey = false; |
|
42 boolean altKey = false; |
|
43 boolean metaKey = false; |
|
44 boolean repeat = false; |
|
45 boolean isComposing = false; |
|
46 |
|
47 // legacy attributes |
|
48 unsigned long charCode = 0; |
|
49 unsigned long keyCode = 0; |
|
50 unsigned long which = 0; |
|
51 }; |
|
52 |
|
53 // Mozilla extensions |
|
54 KeyboardEvent implements KeyEvent; |