michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: */ michael@0: michael@0: interface WindowProxy; michael@0: michael@0: [Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)] michael@0: interface KeyboardEvent : UIEvent michael@0: { michael@0: readonly attribute unsigned long charCode; michael@0: readonly attribute unsigned long keyCode; michael@0: michael@0: readonly attribute boolean altKey; michael@0: readonly attribute boolean ctrlKey; michael@0: readonly attribute boolean shiftKey; michael@0: readonly attribute boolean metaKey; michael@0: michael@0: boolean getModifierState(DOMString key); michael@0: michael@0: const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00; michael@0: const unsigned long DOM_KEY_LOCATION_LEFT = 0x01; michael@0: const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02; michael@0: const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03; michael@0: const unsigned long DOM_KEY_LOCATION_MOBILE = 0x04; michael@0: const unsigned long DOM_KEY_LOCATION_JOYSTICK = 0x05; michael@0: michael@0: readonly attribute unsigned long location; michael@0: readonly attribute boolean repeat; michael@0: readonly attribute boolean isComposing; michael@0: michael@0: readonly attribute DOMString key; michael@0: }; michael@0: michael@0: dictionary KeyboardEventInit : UIEventInit michael@0: { michael@0: DOMString key = ""; michael@0: unsigned long location = 0; michael@0: boolean ctrlKey = false; michael@0: boolean shiftKey = false; michael@0: boolean altKey = false; michael@0: boolean metaKey = false; michael@0: boolean repeat = false; michael@0: boolean isComposing = false; michael@0: michael@0: // legacy attributes michael@0: unsigned long charCode = 0; michael@0: unsigned long keyCode = 0; michael@0: unsigned long which = 0; michael@0: }; michael@0: michael@0: // Mozilla extensions michael@0: KeyboardEvent implements KeyEvent;