Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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 */
7 interface WindowProxy;
9 [Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)]
10 interface KeyboardEvent : UIEvent
11 {
12 readonly attribute unsigned long charCode;
13 readonly attribute unsigned long keyCode;
15 readonly attribute boolean altKey;
16 readonly attribute boolean ctrlKey;
17 readonly attribute boolean shiftKey;
18 readonly attribute boolean metaKey;
20 boolean getModifierState(DOMString key);
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;
29 readonly attribute unsigned long location;
30 readonly attribute boolean repeat;
31 readonly attribute boolean isComposing;
33 readonly attribute DOMString key;
34 };
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;
47 // legacy attributes
48 unsigned long charCode = 0;
49 unsigned long keyCode = 0;
50 unsigned long which = 0;
51 };
53 // Mozilla extensions
54 KeyboardEvent implements KeyEvent;