dom/interfaces/events/nsIDOMKeyEvent.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/interfaces/events/nsIDOMKeyEvent.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,260 @@
     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
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsIDOMUIEvent.idl"
    1.10 +
    1.11 +[scriptable, builtinclass, uuid(d2b3e35f-8627-4732-a92d-cda54c8f8054)]
    1.12 +interface nsIDOMKeyEvent : nsIDOMUIEvent
    1.13 +{
    1.14 +  const unsigned long DOM_VK_CANCEL         = 0x03;
    1.15 +  const unsigned long DOM_VK_HELP           = 0x06;
    1.16 +  const unsigned long DOM_VK_BACK_SPACE     = 0x08;
    1.17 +  const unsigned long DOM_VK_TAB            = 0x09;
    1.18 +  const unsigned long DOM_VK_CLEAR          = 0x0C;
    1.19 +  const unsigned long DOM_VK_RETURN         = 0x0D;
    1.20 +  // DOM_VK_ENTER has been never used for representing native key events.
    1.21 +  // Therefore, it's removed for preventing developers being confused.
    1.22 +  // const unsigned long DOM_VK_ENTER          = 0x0E;
    1.23 +  const unsigned long DOM_VK_SHIFT          = 0x10;
    1.24 +  const unsigned long DOM_VK_CONTROL        = 0x11;
    1.25 +  const unsigned long DOM_VK_ALT            = 0x12;
    1.26 +  const unsigned long DOM_VK_PAUSE          = 0x13;
    1.27 +  const unsigned long DOM_VK_CAPS_LOCK      = 0x14;
    1.28 +  const unsigned long DOM_VK_KANA           = 0x15;
    1.29 +  const unsigned long DOM_VK_HANGUL         = 0x15;
    1.30 +  const unsigned long DOM_VK_EISU           = 0x16; // Japanese Mac keyboard only
    1.31 +  const unsigned long DOM_VK_JUNJA          = 0x17;
    1.32 +  const unsigned long DOM_VK_FINAL          = 0x18;
    1.33 +  const unsigned long DOM_VK_HANJA          = 0x19;
    1.34 +  const unsigned long DOM_VK_KANJI          = 0x19;
    1.35 +  const unsigned long DOM_VK_ESCAPE         = 0x1B;
    1.36 +  const unsigned long DOM_VK_CONVERT        = 0x1C;
    1.37 +  const unsigned long DOM_VK_NONCONVERT     = 0x1D;
    1.38 +  const unsigned long DOM_VK_ACCEPT         = 0x1E;
    1.39 +  const unsigned long DOM_VK_MODECHANGE     = 0x1F;
    1.40 +  const unsigned long DOM_VK_SPACE          = 0x20;
    1.41 +  const unsigned long DOM_VK_PAGE_UP        = 0x21;
    1.42 +  const unsigned long DOM_VK_PAGE_DOWN      = 0x22;
    1.43 +  const unsigned long DOM_VK_END            = 0x23;
    1.44 +  const unsigned long DOM_VK_HOME           = 0x24;
    1.45 +  const unsigned long DOM_VK_LEFT           = 0x25;
    1.46 +  const unsigned long DOM_VK_UP             = 0x26;
    1.47 +  const unsigned long DOM_VK_RIGHT          = 0x27;
    1.48 +  const unsigned long DOM_VK_DOWN           = 0x28;
    1.49 +  const unsigned long DOM_VK_SELECT         = 0x29;
    1.50 +  const unsigned long DOM_VK_PRINT          = 0x2A;
    1.51 +  const unsigned long DOM_VK_EXECUTE        = 0x2B;
    1.52 +  const unsigned long DOM_VK_PRINTSCREEN    = 0x2C;
    1.53 +  const unsigned long DOM_VK_INSERT         = 0x2D;
    1.54 +  const unsigned long DOM_VK_DELETE         = 0x2E;
    1.55 +
    1.56 +  // DOM_VK_0 - DOM_VK_9 match their ascii values
    1.57 +  const unsigned long DOM_VK_0              = 0x30;
    1.58 +  const unsigned long DOM_VK_1              = 0x31;
    1.59 +  const unsigned long DOM_VK_2              = 0x32;
    1.60 +  const unsigned long DOM_VK_3              = 0x33;
    1.61 +  const unsigned long DOM_VK_4              = 0x34;
    1.62 +  const unsigned long DOM_VK_5              = 0x35;
    1.63 +  const unsigned long DOM_VK_6              = 0x36;
    1.64 +  const unsigned long DOM_VK_7              = 0x37;
    1.65 +  const unsigned long DOM_VK_8              = 0x38;
    1.66 +  const unsigned long DOM_VK_9              = 0x39;
    1.67 +
    1.68 +  const unsigned long DOM_VK_COLON          = 0x3A;
    1.69 +  const unsigned long DOM_VK_SEMICOLON      = 0x3B;
    1.70 +  const unsigned long DOM_VK_LESS_THAN      = 0x3C;
    1.71 +  const unsigned long DOM_VK_EQUALS         = 0x3D;
    1.72 +  const unsigned long DOM_VK_GREATER_THAN   = 0x3E;
    1.73 +  const unsigned long DOM_VK_QUESTION_MARK  = 0x3F;
    1.74 +  const unsigned long DOM_VK_AT             = 0x40;
    1.75 +
    1.76 +  // DOM_VK_A - DOM_VK_Z match their ascii values
    1.77 +  const unsigned long DOM_VK_A              = 0x41;
    1.78 +  const unsigned long DOM_VK_B              = 0x42;
    1.79 +  const unsigned long DOM_VK_C              = 0x43;
    1.80 +  const unsigned long DOM_VK_D              = 0x44;
    1.81 +  const unsigned long DOM_VK_E              = 0x45;
    1.82 +  const unsigned long DOM_VK_F              = 0x46;
    1.83 +  const unsigned long DOM_VK_G              = 0x47;
    1.84 +  const unsigned long DOM_VK_H              = 0x48;
    1.85 +  const unsigned long DOM_VK_I              = 0x49;
    1.86 +  const unsigned long DOM_VK_J              = 0x4A;
    1.87 +  const unsigned long DOM_VK_K              = 0x4B;
    1.88 +  const unsigned long DOM_VK_L              = 0x4C;
    1.89 +  const unsigned long DOM_VK_M              = 0x4D;
    1.90 +  const unsigned long DOM_VK_N              = 0x4E;
    1.91 +  const unsigned long DOM_VK_O              = 0x4F;
    1.92 +  const unsigned long DOM_VK_P              = 0x50;
    1.93 +  const unsigned long DOM_VK_Q              = 0x51;
    1.94 +  const unsigned long DOM_VK_R              = 0x52;
    1.95 +  const unsigned long DOM_VK_S              = 0x53;
    1.96 +  const unsigned long DOM_VK_T              = 0x54;
    1.97 +  const unsigned long DOM_VK_U              = 0x55;
    1.98 +  const unsigned long DOM_VK_V              = 0x56;
    1.99 +  const unsigned long DOM_VK_W              = 0x57;
   1.100 +  const unsigned long DOM_VK_X              = 0x58;
   1.101 +  const unsigned long DOM_VK_Y              = 0x59;
   1.102 +  const unsigned long DOM_VK_Z              = 0x5A;
   1.103 +
   1.104 +  const unsigned long DOM_VK_WIN            = 0x5B;
   1.105 +  const unsigned long DOM_VK_CONTEXT_MENU   = 0x5D;
   1.106 +  const unsigned long DOM_VK_SLEEP          = 0x5F;
   1.107 +
   1.108 +  // Numpad keys
   1.109 +  const unsigned long DOM_VK_NUMPAD0        = 0x60;
   1.110 +  const unsigned long DOM_VK_NUMPAD1        = 0x61;
   1.111 +  const unsigned long DOM_VK_NUMPAD2        = 0x62;
   1.112 +  const unsigned long DOM_VK_NUMPAD3        = 0x63;
   1.113 +  const unsigned long DOM_VK_NUMPAD4        = 0x64;
   1.114 +  const unsigned long DOM_VK_NUMPAD5        = 0x65;
   1.115 +  const unsigned long DOM_VK_NUMPAD6        = 0x66;
   1.116 +  const unsigned long DOM_VK_NUMPAD7        = 0x67;
   1.117 +  const unsigned long DOM_VK_NUMPAD8        = 0x68;
   1.118 +  const unsigned long DOM_VK_NUMPAD9        = 0x69;
   1.119 +  const unsigned long DOM_VK_MULTIPLY       = 0x6A;
   1.120 +  const unsigned long DOM_VK_ADD            = 0x6B;
   1.121 +  const unsigned long DOM_VK_SEPARATOR      = 0x6C;
   1.122 +  const unsigned long DOM_VK_SUBTRACT       = 0x6D;
   1.123 +  const unsigned long DOM_VK_DECIMAL        = 0x6E;
   1.124 +  const unsigned long DOM_VK_DIVIDE         = 0x6F;
   1.125 +
   1.126 +  const unsigned long DOM_VK_F1             = 0x70;
   1.127 +  const unsigned long DOM_VK_F2             = 0x71;
   1.128 +  const unsigned long DOM_VK_F3             = 0x72;
   1.129 +  const unsigned long DOM_VK_F4             = 0x73;
   1.130 +  const unsigned long DOM_VK_F5             = 0x74;
   1.131 +  const unsigned long DOM_VK_F6             = 0x75;
   1.132 +  const unsigned long DOM_VK_F7             = 0x76;
   1.133 +  const unsigned long DOM_VK_F8             = 0x77;
   1.134 +  const unsigned long DOM_VK_F9             = 0x78;
   1.135 +  const unsigned long DOM_VK_F10            = 0x79;
   1.136 +  const unsigned long DOM_VK_F11            = 0x7A;
   1.137 +  const unsigned long DOM_VK_F12            = 0x7B;
   1.138 +  const unsigned long DOM_VK_F13            = 0x7C;
   1.139 +  const unsigned long DOM_VK_F14            = 0x7D;
   1.140 +  const unsigned long DOM_VK_F15            = 0x7E;
   1.141 +  const unsigned long DOM_VK_F16            = 0x7F;
   1.142 +  const unsigned long DOM_VK_F17            = 0x80;
   1.143 +  const unsigned long DOM_VK_F18            = 0x81;
   1.144 +  const unsigned long DOM_VK_F19            = 0x82;
   1.145 +  const unsigned long DOM_VK_F20            = 0x83;
   1.146 +  const unsigned long DOM_VK_F21            = 0x84;
   1.147 +  const unsigned long DOM_VK_F22            = 0x85;
   1.148 +  const unsigned long DOM_VK_F23            = 0x86;
   1.149 +  const unsigned long DOM_VK_F24            = 0x87;
   1.150 +
   1.151 +  const unsigned long DOM_VK_NUM_LOCK       = 0x90;
   1.152 +  const unsigned long DOM_VK_SCROLL_LOCK    = 0x91;
   1.153 +
   1.154 +  // OEM specific virtual keyCode of Windows should pass through DOM keyCode
   1.155 +  // for compatibility with the other web browsers on Windows.
   1.156 +  const unsigned long DOM_VK_WIN_OEM_FJ_JISHO   = 0x92;
   1.157 +  const unsigned long DOM_VK_WIN_OEM_FJ_MASSHOU = 0x93;
   1.158 +  const unsigned long DOM_VK_WIN_OEM_FJ_TOUROKU = 0x94;
   1.159 +  const unsigned long DOM_VK_WIN_OEM_FJ_LOYA    = 0x95;
   1.160 +  const unsigned long DOM_VK_WIN_OEM_FJ_ROYA    = 0x96;
   1.161 +
   1.162 +  const unsigned long DOM_VK_CIRCUMFLEX     = 0xA0;
   1.163 +  const unsigned long DOM_VK_EXCLAMATION    = 0xA1;
   1.164 +  const unsigned long DOM_VK_DOUBLE_QUOTE   = 0xA2;
   1.165 +  const unsigned long DOM_VK_HASH           = 0xA3;
   1.166 +  const unsigned long DOM_VK_DOLLAR         = 0xA4;
   1.167 +  const unsigned long DOM_VK_PERCENT        = 0xA5;
   1.168 +  const unsigned long DOM_VK_AMPERSAND      = 0xA6;
   1.169 +  const unsigned long DOM_VK_UNDERSCORE     = 0xA7;
   1.170 +  const unsigned long DOM_VK_OPEN_PAREN     = 0xA8;
   1.171 +  const unsigned long DOM_VK_CLOSE_PAREN    = 0xA9;
   1.172 +  const unsigned long DOM_VK_ASTERISK       = 0xAA;
   1.173 +  const unsigned long DOM_VK_PLUS           = 0xAB;
   1.174 +  const unsigned long DOM_VK_PIPE           = 0xAC;
   1.175 +  const unsigned long DOM_VK_HYPHEN_MINUS   = 0xAD;
   1.176 +
   1.177 +  const unsigned long DOM_VK_OPEN_CURLY_BRACKET  = 0xAE;
   1.178 +  const unsigned long DOM_VK_CLOSE_CURLY_BRACKET = 0xAF;
   1.179 +
   1.180 +  const unsigned long DOM_VK_TILDE          = 0xB0;
   1.181 +
   1.182 +  const unsigned long DOM_VK_VOLUME_MUTE    = 0xB5;
   1.183 +  const unsigned long DOM_VK_VOLUME_DOWN    = 0xB6;
   1.184 +  const unsigned long DOM_VK_VOLUME_UP      = 0xB7;
   1.185 +
   1.186 +  const unsigned long DOM_VK_COMMA          = 0xBC;
   1.187 +  const unsigned long DOM_VK_PERIOD         = 0xBE;
   1.188 +  const unsigned long DOM_VK_SLASH          = 0xBF;
   1.189 +  const unsigned long DOM_VK_BACK_QUOTE     = 0xC0;
   1.190 +  const unsigned long DOM_VK_OPEN_BRACKET   = 0xDB; // square bracket
   1.191 +  const unsigned long DOM_VK_BACK_SLASH     = 0xDC;
   1.192 +  const unsigned long DOM_VK_CLOSE_BRACKET  = 0xDD; // square bracket
   1.193 +  const unsigned long DOM_VK_QUOTE          = 0xDE; // Apostrophe
   1.194 +
   1.195 +  const unsigned long DOM_VK_META           = 0xE0;
   1.196 +  const unsigned long DOM_VK_ALTGR          = 0xE1;
   1.197 +
   1.198 +  // OEM specific virtual keyCode of Windows should pass through DOM keyCode
   1.199 +  // for compatibility with the other web browsers on Windows.
   1.200 +  const unsigned long DOM_VK_WIN_ICO_HELP    = 0xE3;
   1.201 +  const unsigned long DOM_VK_WIN_ICO_00      = 0xE4;
   1.202 +  const unsigned long DOM_VK_WIN_ICO_CLEAR   = 0xE6;
   1.203 +  const unsigned long DOM_VK_WIN_OEM_RESET   = 0xE9;
   1.204 +  const unsigned long DOM_VK_WIN_OEM_JUMP    = 0xEA;
   1.205 +  const unsigned long DOM_VK_WIN_OEM_PA1     = 0xEB;
   1.206 +  const unsigned long DOM_VK_WIN_OEM_PA2     = 0xEC;
   1.207 +  const unsigned long DOM_VK_WIN_OEM_PA3     = 0xED;
   1.208 +  const unsigned long DOM_VK_WIN_OEM_WSCTRL  = 0xEE;
   1.209 +  const unsigned long DOM_VK_WIN_OEM_CUSEL   = 0xEF;
   1.210 +  const unsigned long DOM_VK_WIN_OEM_ATTN    = 0xF0;
   1.211 +  const unsigned long DOM_VK_WIN_OEM_FINISH  = 0xF1;
   1.212 +  const unsigned long DOM_VK_WIN_OEM_COPY    = 0xF2;
   1.213 +  const unsigned long DOM_VK_WIN_OEM_AUTO    = 0xF3;
   1.214 +  const unsigned long DOM_VK_WIN_OEM_ENLW    = 0xF4;
   1.215 +  const unsigned long DOM_VK_WIN_OEM_BACKTAB = 0xF5;
   1.216 +
   1.217 +  // Following keys are not used on most keyboards.  However, for compatibility
   1.218 +  // with other browsers on Windows, we should define them.
   1.219 +  const unsigned long DOM_VK_ATTN           = 0xF6;
   1.220 +  const unsigned long DOM_VK_CRSEL          = 0xF7;
   1.221 +  const unsigned long DOM_VK_EXSEL          = 0xF8;
   1.222 +  const unsigned long DOM_VK_EREOF          = 0xF9;
   1.223 +  const unsigned long DOM_VK_PLAY           = 0xFA;
   1.224 +  const unsigned long DOM_VK_ZOOM           = 0xFB;
   1.225 +  const unsigned long DOM_VK_PA1            = 0xFD;
   1.226 +
   1.227 +  // OEM specific virtual keyCode of Windows should pass through DOM keyCode
   1.228 +  // for compatibility with the other web browsers on Windows.
   1.229 +  const unsigned long DOM_VK_WIN_OEM_CLEAR  = 0xFE;
   1.230 +
   1.231 +  readonly attribute unsigned long    charCode;
   1.232 +  readonly attribute unsigned long    keyCode;
   1.233 +
   1.234 +  readonly attribute boolean          altKey;
   1.235 +  readonly attribute boolean          ctrlKey;
   1.236 +  readonly attribute boolean          shiftKey;
   1.237 +  readonly attribute boolean          metaKey;
   1.238 +
   1.239 +  void                      initKeyEvent(in DOMString typeArg,
   1.240 +                                         in boolean canBubbleArg,
   1.241 +                                         in boolean cancelableArg,
   1.242 +                                         in nsIDOMWindow viewArg,
   1.243 +                                         in boolean ctrlKeyArg,
   1.244 +                                         in boolean altKeyArg,
   1.245 +                                         in boolean shiftKeyArg,
   1.246 +                                         in boolean metaKeyArg,
   1.247 +                                         in unsigned long keyCodeArg,
   1.248 +                                         in unsigned long charCodeArg);
   1.249 +
   1.250 +  bool getModifierState(in DOMString keyArg);
   1.251 +
   1.252 +  const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00;
   1.253 +  const unsigned long DOM_KEY_LOCATION_LEFT     = 0x01;
   1.254 +  const unsigned long DOM_KEY_LOCATION_RIGHT    = 0x02;
   1.255 +  const unsigned long DOM_KEY_LOCATION_NUMPAD   = 0x03;
   1.256 +  const unsigned long DOM_KEY_LOCATION_MOBILE   = 0x04;
   1.257 +  const unsigned long DOM_KEY_LOCATION_JOYSTICK = 0x05;
   1.258 +
   1.259 +  readonly attribute unsigned long location;
   1.260 +  readonly attribute boolean       repeat;
   1.261 +
   1.262 +  readonly attribute DOMString key;
   1.263 +};

mercurial