dom/webidl/KeyboardEvent.webidl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/webidl/KeyboardEvent.webidl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,54 @@
     1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 + */
     1.9 +
    1.10 +interface WindowProxy;
    1.11 +
    1.12 +[Constructor(DOMString typeArg, optional KeyboardEventInit keyboardEventInitDict)]
    1.13 +interface KeyboardEvent : UIEvent
    1.14 +{
    1.15 +  readonly attribute unsigned long    charCode;
    1.16 +  readonly attribute unsigned long    keyCode;
    1.17 +
    1.18 +  readonly attribute boolean          altKey;
    1.19 +  readonly attribute boolean          ctrlKey;
    1.20 +  readonly attribute boolean          shiftKey;
    1.21 +  readonly attribute boolean          metaKey;
    1.22 +
    1.23 +  boolean getModifierState(DOMString key);
    1.24 +
    1.25 +  const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00;
    1.26 +  const unsigned long DOM_KEY_LOCATION_LEFT     = 0x01;
    1.27 +  const unsigned long DOM_KEY_LOCATION_RIGHT    = 0x02;
    1.28 +  const unsigned long DOM_KEY_LOCATION_NUMPAD   = 0x03;
    1.29 +  const unsigned long DOM_KEY_LOCATION_MOBILE   = 0x04;
    1.30 +  const unsigned long DOM_KEY_LOCATION_JOYSTICK = 0x05;
    1.31 +
    1.32 +  readonly attribute unsigned long location;
    1.33 +  readonly attribute boolean       repeat;
    1.34 +  readonly attribute boolean       isComposing;
    1.35 +
    1.36 +  readonly attribute DOMString key;
    1.37 +};
    1.38 +
    1.39 +dictionary KeyboardEventInit : UIEventInit
    1.40 +{
    1.41 +  DOMString      key           = "";
    1.42 +  unsigned long  location      = 0;
    1.43 +  boolean        ctrlKey       = false;
    1.44 +  boolean        shiftKey      = false;
    1.45 +  boolean        altKey        = false;
    1.46 +  boolean        metaKey       = false;
    1.47 +  boolean        repeat        = false;
    1.48 +  boolean        isComposing   = false;
    1.49 +
    1.50 +  // legacy attributes
    1.51 +  unsigned long  charCode      = 0;
    1.52 +  unsigned long  keyCode       = 0;
    1.53 +  unsigned long  which         = 0;
    1.54 +};
    1.55 +
    1.56 +// Mozilla extensions
    1.57 +KeyboardEvent implements KeyEvent;

mercurial