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/.
8 interface KeyboardEvent : UIEvent
10 [BinaryName="constructorJS"]
11 constructor(DOMString typeArg,
12 optional KeyboardEventInit keyboardEventInitDict= {});
15 readonly attribute unsigned long charCode;
17 readonly attribute unsigned long keyCode;
20 readonly attribute boolean altKey;
22 readonly attribute boolean ctrlKey;
24 readonly attribute boolean shiftKey;
25 readonly attribute boolean metaKey;
28 boolean getModifierState(DOMString key);
30 const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00;
31 const unsigned long DOM_KEY_LOCATION_LEFT = 0x01;
32 const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02;
33 const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03;
35 readonly attribute unsigned long location;
36 readonly attribute boolean repeat;
37 readonly attribute boolean isComposing;
39 readonly attribute DOMString key;
41 readonly attribute DOMString code;
43 [BinaryName="initKeyboardEventJS"]
44 undefined initKeyboardEvent(DOMString typeArg,
45 optional boolean bubblesArg = false,
46 optional boolean cancelableArg = false,
47 optional Window? viewArg = null,
48 optional DOMString keyArg = "",
49 optional unsigned long locationArg = 0,
50 optional boolean ctrlKey = false,
51 optional boolean altKey = false,
52 optional boolean shiftKey = false,
53 optional boolean metaKey = false);
55 // This returns the initialized dictionary for generating a
56 // same-type keyboard event
57 [Cached, ChromeOnly, Constant]
58 readonly attribute KeyboardEventInit initDict;
61 dictionary KeyboardEventInit : EventModifierInit
63 [BinaryType="nsAutoString"]
65 [BinaryType="nsAutoString"]
67 unsigned long location = 0;
68 boolean repeat = false;
69 boolean isComposing = false;
72 unsigned long charCode = 0;
73 unsigned long keyCode = 0;
74 unsigned long which = 0;
78 KeyboardEvent includes KeyEventMixin;