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/.
9 [Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)]
10 interface KeyboardEvent : UIEvent
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 [Pref="dom.keyboardevent.code.enabled"]
35 readonly attribute DOMString code;
38 dictionary KeyboardEventInit : UIEventInit
42 unsigned long location = 0;
43 boolean ctrlKey = false;
44 boolean shiftKey = false;
45 boolean altKey = false;
46 boolean metaKey = false;
47 boolean repeat = false;
48 boolean isComposing = false;
51 unsigned long charCode = 0;
52 unsigned long keyCode = 0;
53 unsigned long which = 0;
57 KeyboardEvent implements KeyEvent;