dom/interfaces/events/nsIDOMKeyEvent.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsIDOMUIEvent.idl"
michael@0 7
michael@0 8 [scriptable, builtinclass, uuid(d2b3e35f-8627-4732-a92d-cda54c8f8054)]
michael@0 9 interface nsIDOMKeyEvent : nsIDOMUIEvent
michael@0 10 {
michael@0 11 const unsigned long DOM_VK_CANCEL = 0x03;
michael@0 12 const unsigned long DOM_VK_HELP = 0x06;
michael@0 13 const unsigned long DOM_VK_BACK_SPACE = 0x08;
michael@0 14 const unsigned long DOM_VK_TAB = 0x09;
michael@0 15 const unsigned long DOM_VK_CLEAR = 0x0C;
michael@0 16 const unsigned long DOM_VK_RETURN = 0x0D;
michael@0 17 // DOM_VK_ENTER has been never used for representing native key events.
michael@0 18 // Therefore, it's removed for preventing developers being confused.
michael@0 19 // const unsigned long DOM_VK_ENTER = 0x0E;
michael@0 20 const unsigned long DOM_VK_SHIFT = 0x10;
michael@0 21 const unsigned long DOM_VK_CONTROL = 0x11;
michael@0 22 const unsigned long DOM_VK_ALT = 0x12;
michael@0 23 const unsigned long DOM_VK_PAUSE = 0x13;
michael@0 24 const unsigned long DOM_VK_CAPS_LOCK = 0x14;
michael@0 25 const unsigned long DOM_VK_KANA = 0x15;
michael@0 26 const unsigned long DOM_VK_HANGUL = 0x15;
michael@0 27 const unsigned long DOM_VK_EISU = 0x16; // Japanese Mac keyboard only
michael@0 28 const unsigned long DOM_VK_JUNJA = 0x17;
michael@0 29 const unsigned long DOM_VK_FINAL = 0x18;
michael@0 30 const unsigned long DOM_VK_HANJA = 0x19;
michael@0 31 const unsigned long DOM_VK_KANJI = 0x19;
michael@0 32 const unsigned long DOM_VK_ESCAPE = 0x1B;
michael@0 33 const unsigned long DOM_VK_CONVERT = 0x1C;
michael@0 34 const unsigned long DOM_VK_NONCONVERT = 0x1D;
michael@0 35 const unsigned long DOM_VK_ACCEPT = 0x1E;
michael@0 36 const unsigned long DOM_VK_MODECHANGE = 0x1F;
michael@0 37 const unsigned long DOM_VK_SPACE = 0x20;
michael@0 38 const unsigned long DOM_VK_PAGE_UP = 0x21;
michael@0 39 const unsigned long DOM_VK_PAGE_DOWN = 0x22;
michael@0 40 const unsigned long DOM_VK_END = 0x23;
michael@0 41 const unsigned long DOM_VK_HOME = 0x24;
michael@0 42 const unsigned long DOM_VK_LEFT = 0x25;
michael@0 43 const unsigned long DOM_VK_UP = 0x26;
michael@0 44 const unsigned long DOM_VK_RIGHT = 0x27;
michael@0 45 const unsigned long DOM_VK_DOWN = 0x28;
michael@0 46 const unsigned long DOM_VK_SELECT = 0x29;
michael@0 47 const unsigned long DOM_VK_PRINT = 0x2A;
michael@0 48 const unsigned long DOM_VK_EXECUTE = 0x2B;
michael@0 49 const unsigned long DOM_VK_PRINTSCREEN = 0x2C;
michael@0 50 const unsigned long DOM_VK_INSERT = 0x2D;
michael@0 51 const unsigned long DOM_VK_DELETE = 0x2E;
michael@0 52
michael@0 53 // DOM_VK_0 - DOM_VK_9 match their ascii values
michael@0 54 const unsigned long DOM_VK_0 = 0x30;
michael@0 55 const unsigned long DOM_VK_1 = 0x31;
michael@0 56 const unsigned long DOM_VK_2 = 0x32;
michael@0 57 const unsigned long DOM_VK_3 = 0x33;
michael@0 58 const unsigned long DOM_VK_4 = 0x34;
michael@0 59 const unsigned long DOM_VK_5 = 0x35;
michael@0 60 const unsigned long DOM_VK_6 = 0x36;
michael@0 61 const unsigned long DOM_VK_7 = 0x37;
michael@0 62 const unsigned long DOM_VK_8 = 0x38;
michael@0 63 const unsigned long DOM_VK_9 = 0x39;
michael@0 64
michael@0 65 const unsigned long DOM_VK_COLON = 0x3A;
michael@0 66 const unsigned long DOM_VK_SEMICOLON = 0x3B;
michael@0 67 const unsigned long DOM_VK_LESS_THAN = 0x3C;
michael@0 68 const unsigned long DOM_VK_EQUALS = 0x3D;
michael@0 69 const unsigned long DOM_VK_GREATER_THAN = 0x3E;
michael@0 70 const unsigned long DOM_VK_QUESTION_MARK = 0x3F;
michael@0 71 const unsigned long DOM_VK_AT = 0x40;
michael@0 72
michael@0 73 // DOM_VK_A - DOM_VK_Z match their ascii values
michael@0 74 const unsigned long DOM_VK_A = 0x41;
michael@0 75 const unsigned long DOM_VK_B = 0x42;
michael@0 76 const unsigned long DOM_VK_C = 0x43;
michael@0 77 const unsigned long DOM_VK_D = 0x44;
michael@0 78 const unsigned long DOM_VK_E = 0x45;
michael@0 79 const unsigned long DOM_VK_F = 0x46;
michael@0 80 const unsigned long DOM_VK_G = 0x47;
michael@0 81 const unsigned long DOM_VK_H = 0x48;
michael@0 82 const unsigned long DOM_VK_I = 0x49;
michael@0 83 const unsigned long DOM_VK_J = 0x4A;
michael@0 84 const unsigned long DOM_VK_K = 0x4B;
michael@0 85 const unsigned long DOM_VK_L = 0x4C;
michael@0 86 const unsigned long DOM_VK_M = 0x4D;
michael@0 87 const unsigned long DOM_VK_N = 0x4E;
michael@0 88 const unsigned long DOM_VK_O = 0x4F;
michael@0 89 const unsigned long DOM_VK_P = 0x50;
michael@0 90 const unsigned long DOM_VK_Q = 0x51;
michael@0 91 const unsigned long DOM_VK_R = 0x52;
michael@0 92 const unsigned long DOM_VK_S = 0x53;
michael@0 93 const unsigned long DOM_VK_T = 0x54;
michael@0 94 const unsigned long DOM_VK_U = 0x55;
michael@0 95 const unsigned long DOM_VK_V = 0x56;
michael@0 96 const unsigned long DOM_VK_W = 0x57;
michael@0 97 const unsigned long DOM_VK_X = 0x58;
michael@0 98 const unsigned long DOM_VK_Y = 0x59;
michael@0 99 const unsigned long DOM_VK_Z = 0x5A;
michael@0 100
michael@0 101 const unsigned long DOM_VK_WIN = 0x5B;
michael@0 102 const unsigned long DOM_VK_CONTEXT_MENU = 0x5D;
michael@0 103 const unsigned long DOM_VK_SLEEP = 0x5F;
michael@0 104
michael@0 105 // Numpad keys
michael@0 106 const unsigned long DOM_VK_NUMPAD0 = 0x60;
michael@0 107 const unsigned long DOM_VK_NUMPAD1 = 0x61;
michael@0 108 const unsigned long DOM_VK_NUMPAD2 = 0x62;
michael@0 109 const unsigned long DOM_VK_NUMPAD3 = 0x63;
michael@0 110 const unsigned long DOM_VK_NUMPAD4 = 0x64;
michael@0 111 const unsigned long DOM_VK_NUMPAD5 = 0x65;
michael@0 112 const unsigned long DOM_VK_NUMPAD6 = 0x66;
michael@0 113 const unsigned long DOM_VK_NUMPAD7 = 0x67;
michael@0 114 const unsigned long DOM_VK_NUMPAD8 = 0x68;
michael@0 115 const unsigned long DOM_VK_NUMPAD9 = 0x69;
michael@0 116 const unsigned long DOM_VK_MULTIPLY = 0x6A;
michael@0 117 const unsigned long DOM_VK_ADD = 0x6B;
michael@0 118 const unsigned long DOM_VK_SEPARATOR = 0x6C;
michael@0 119 const unsigned long DOM_VK_SUBTRACT = 0x6D;
michael@0 120 const unsigned long DOM_VK_DECIMAL = 0x6E;
michael@0 121 const unsigned long DOM_VK_DIVIDE = 0x6F;
michael@0 122
michael@0 123 const unsigned long DOM_VK_F1 = 0x70;
michael@0 124 const unsigned long DOM_VK_F2 = 0x71;
michael@0 125 const unsigned long DOM_VK_F3 = 0x72;
michael@0 126 const unsigned long DOM_VK_F4 = 0x73;
michael@0 127 const unsigned long DOM_VK_F5 = 0x74;
michael@0 128 const unsigned long DOM_VK_F6 = 0x75;
michael@0 129 const unsigned long DOM_VK_F7 = 0x76;
michael@0 130 const unsigned long DOM_VK_F8 = 0x77;
michael@0 131 const unsigned long DOM_VK_F9 = 0x78;
michael@0 132 const unsigned long DOM_VK_F10 = 0x79;
michael@0 133 const unsigned long DOM_VK_F11 = 0x7A;
michael@0 134 const unsigned long DOM_VK_F12 = 0x7B;
michael@0 135 const unsigned long DOM_VK_F13 = 0x7C;
michael@0 136 const unsigned long DOM_VK_F14 = 0x7D;
michael@0 137 const unsigned long DOM_VK_F15 = 0x7E;
michael@0 138 const unsigned long DOM_VK_F16 = 0x7F;
michael@0 139 const unsigned long DOM_VK_F17 = 0x80;
michael@0 140 const unsigned long DOM_VK_F18 = 0x81;
michael@0 141 const unsigned long DOM_VK_F19 = 0x82;
michael@0 142 const unsigned long DOM_VK_F20 = 0x83;
michael@0 143 const unsigned long DOM_VK_F21 = 0x84;
michael@0 144 const unsigned long DOM_VK_F22 = 0x85;
michael@0 145 const unsigned long DOM_VK_F23 = 0x86;
michael@0 146 const unsigned long DOM_VK_F24 = 0x87;
michael@0 147
michael@0 148 const unsigned long DOM_VK_NUM_LOCK = 0x90;
michael@0 149 const unsigned long DOM_VK_SCROLL_LOCK = 0x91;
michael@0 150
michael@0 151 // OEM specific virtual keyCode of Windows should pass through DOM keyCode
michael@0 152 // for compatibility with the other web browsers on Windows.
michael@0 153 const unsigned long DOM_VK_WIN_OEM_FJ_JISHO = 0x92;
michael@0 154 const unsigned long DOM_VK_WIN_OEM_FJ_MASSHOU = 0x93;
michael@0 155 const unsigned long DOM_VK_WIN_OEM_FJ_TOUROKU = 0x94;
michael@0 156 const unsigned long DOM_VK_WIN_OEM_FJ_LOYA = 0x95;
michael@0 157 const unsigned long DOM_VK_WIN_OEM_FJ_ROYA = 0x96;
michael@0 158
michael@0 159 const unsigned long DOM_VK_CIRCUMFLEX = 0xA0;
michael@0 160 const unsigned long DOM_VK_EXCLAMATION = 0xA1;
michael@0 161 const unsigned long DOM_VK_DOUBLE_QUOTE = 0xA2;
michael@0 162 const unsigned long DOM_VK_HASH = 0xA3;
michael@0 163 const unsigned long DOM_VK_DOLLAR = 0xA4;
michael@0 164 const unsigned long DOM_VK_PERCENT = 0xA5;
michael@0 165 const unsigned long DOM_VK_AMPERSAND = 0xA6;
michael@0 166 const unsigned long DOM_VK_UNDERSCORE = 0xA7;
michael@0 167 const unsigned long DOM_VK_OPEN_PAREN = 0xA8;
michael@0 168 const unsigned long DOM_VK_CLOSE_PAREN = 0xA9;
michael@0 169 const unsigned long DOM_VK_ASTERISK = 0xAA;
michael@0 170 const unsigned long DOM_VK_PLUS = 0xAB;
michael@0 171 const unsigned long DOM_VK_PIPE = 0xAC;
michael@0 172 const unsigned long DOM_VK_HYPHEN_MINUS = 0xAD;
michael@0 173
michael@0 174 const unsigned long DOM_VK_OPEN_CURLY_BRACKET = 0xAE;
michael@0 175 const unsigned long DOM_VK_CLOSE_CURLY_BRACKET = 0xAF;
michael@0 176
michael@0 177 const unsigned long DOM_VK_TILDE = 0xB0;
michael@0 178
michael@0 179 const unsigned long DOM_VK_VOLUME_MUTE = 0xB5;
michael@0 180 const unsigned long DOM_VK_VOLUME_DOWN = 0xB6;
michael@0 181 const unsigned long DOM_VK_VOLUME_UP = 0xB7;
michael@0 182
michael@0 183 const unsigned long DOM_VK_COMMA = 0xBC;
michael@0 184 const unsigned long DOM_VK_PERIOD = 0xBE;
michael@0 185 const unsigned long DOM_VK_SLASH = 0xBF;
michael@0 186 const unsigned long DOM_VK_BACK_QUOTE = 0xC0;
michael@0 187 const unsigned long DOM_VK_OPEN_BRACKET = 0xDB; // square bracket
michael@0 188 const unsigned long DOM_VK_BACK_SLASH = 0xDC;
michael@0 189 const unsigned long DOM_VK_CLOSE_BRACKET = 0xDD; // square bracket
michael@0 190 const unsigned long DOM_VK_QUOTE = 0xDE; // Apostrophe
michael@0 191
michael@0 192 const unsigned long DOM_VK_META = 0xE0;
michael@0 193 const unsigned long DOM_VK_ALTGR = 0xE1;
michael@0 194
michael@0 195 // OEM specific virtual keyCode of Windows should pass through DOM keyCode
michael@0 196 // for compatibility with the other web browsers on Windows.
michael@0 197 const unsigned long DOM_VK_WIN_ICO_HELP = 0xE3;
michael@0 198 const unsigned long DOM_VK_WIN_ICO_00 = 0xE4;
michael@0 199 const unsigned long DOM_VK_WIN_ICO_CLEAR = 0xE6;
michael@0 200 const unsigned long DOM_VK_WIN_OEM_RESET = 0xE9;
michael@0 201 const unsigned long DOM_VK_WIN_OEM_JUMP = 0xEA;
michael@0 202 const unsigned long DOM_VK_WIN_OEM_PA1 = 0xEB;
michael@0 203 const unsigned long DOM_VK_WIN_OEM_PA2 = 0xEC;
michael@0 204 const unsigned long DOM_VK_WIN_OEM_PA3 = 0xED;
michael@0 205 const unsigned long DOM_VK_WIN_OEM_WSCTRL = 0xEE;
michael@0 206 const unsigned long DOM_VK_WIN_OEM_CUSEL = 0xEF;
michael@0 207 const unsigned long DOM_VK_WIN_OEM_ATTN = 0xF0;
michael@0 208 const unsigned long DOM_VK_WIN_OEM_FINISH = 0xF1;
michael@0 209 const unsigned long DOM_VK_WIN_OEM_COPY = 0xF2;
michael@0 210 const unsigned long DOM_VK_WIN_OEM_AUTO = 0xF3;
michael@0 211 const unsigned long DOM_VK_WIN_OEM_ENLW = 0xF4;
michael@0 212 const unsigned long DOM_VK_WIN_OEM_BACKTAB = 0xF5;
michael@0 213
michael@0 214 // Following keys are not used on most keyboards. However, for compatibility
michael@0 215 // with other browsers on Windows, we should define them.
michael@0 216 const unsigned long DOM_VK_ATTN = 0xF6;
michael@0 217 const unsigned long DOM_VK_CRSEL = 0xF7;
michael@0 218 const unsigned long DOM_VK_EXSEL = 0xF8;
michael@0 219 const unsigned long DOM_VK_EREOF = 0xF9;
michael@0 220 const unsigned long DOM_VK_PLAY = 0xFA;
michael@0 221 const unsigned long DOM_VK_ZOOM = 0xFB;
michael@0 222 const unsigned long DOM_VK_PA1 = 0xFD;
michael@0 223
michael@0 224 // OEM specific virtual keyCode of Windows should pass through DOM keyCode
michael@0 225 // for compatibility with the other web browsers on Windows.
michael@0 226 const unsigned long DOM_VK_WIN_OEM_CLEAR = 0xFE;
michael@0 227
michael@0 228 readonly attribute unsigned long charCode;
michael@0 229 readonly attribute unsigned long keyCode;
michael@0 230
michael@0 231 readonly attribute boolean altKey;
michael@0 232 readonly attribute boolean ctrlKey;
michael@0 233 readonly attribute boolean shiftKey;
michael@0 234 readonly attribute boolean metaKey;
michael@0 235
michael@0 236 void initKeyEvent(in DOMString typeArg,
michael@0 237 in boolean canBubbleArg,
michael@0 238 in boolean cancelableArg,
michael@0 239 in nsIDOMWindow viewArg,
michael@0 240 in boolean ctrlKeyArg,
michael@0 241 in boolean altKeyArg,
michael@0 242 in boolean shiftKeyArg,
michael@0 243 in boolean metaKeyArg,
michael@0 244 in unsigned long keyCodeArg,
michael@0 245 in unsigned long charCodeArg);
michael@0 246
michael@0 247 bool getModifierState(in DOMString keyArg);
michael@0 248
michael@0 249 const unsigned long DOM_KEY_LOCATION_STANDARD = 0x00;
michael@0 250 const unsigned long DOM_KEY_LOCATION_LEFT = 0x01;
michael@0 251 const unsigned long DOM_KEY_LOCATION_RIGHT = 0x02;
michael@0 252 const unsigned long DOM_KEY_LOCATION_NUMPAD = 0x03;
michael@0 253 const unsigned long DOM_KEY_LOCATION_MOBILE = 0x04;
michael@0 254 const unsigned long DOM_KEY_LOCATION_JOYSTICK = 0x05;
michael@0 255
michael@0 256 readonly attribute unsigned long location;
michael@0 257 readonly attribute boolean repeat;
michael@0 258
michael@0 259 readonly attribute DOMString key;
michael@0 260 };

mercurial