testing/mochitest/tests/SimpleTest/NativeKeyCodes.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /**
michael@0 2 * This file defines all virtual keycodes for synthesizeNativeKey() of
michael@0 3 * EventUtils.js and nsIDOMWindowUtils.sendNativeKeyEvent().
michael@0 4 * These values are defined in each platform's SDK or documents.
michael@0 5 */
michael@0 6
michael@0 7 // Windows
michael@0 8
michael@0 9 const WIN_VK_LBUTTON = 0x01;
michael@0 10 const WIN_VK_RBUTTON = 0x02;
michael@0 11 const WIN_VK_CANCEL = 0x03;
michael@0 12 const WIN_VK_MBUTTON = 0x04;
michael@0 13 const WIN_VK_XBUTTON1 = 0x05;
michael@0 14 const WIN_VK_XBUTTON2 = 0x06;
michael@0 15 const WIN_VK_BACK = 0x08;
michael@0 16 const WIN_VK_TAB = 0x09;
michael@0 17 const WIN_VK_CLEAR = 0x0C;
michael@0 18 const WIN_VK_RETURN = 0x0D;
michael@0 19 const WIN_VK_SHIFT = 0x10;
michael@0 20 const WIN_VK_CONTROL = 0x11;
michael@0 21 const WIN_VK_MENU = 0x12;
michael@0 22 const WIN_VK_PAUSE = 0x13;
michael@0 23 const WIN_VK_CAPITAL = 0x14;
michael@0 24 const WIN_VK_KANA = 0x15;
michael@0 25 const WIN_VK_HANGUEL = 0x15;
michael@0 26 const WIN_VK_HANGUL = 0x15;
michael@0 27 const WIN_VK_JUNJA = 0x17;
michael@0 28 const WIN_VK_FINAL = 0x18;
michael@0 29 const WIN_VK_HANJA = 0x19;
michael@0 30 const WIN_VK_KANJI = 0x19;
michael@0 31 const WIN_VK_ESCAPE = 0x1B;
michael@0 32 const WIN_VK_CONVERT = 0x1C;
michael@0 33 const WIN_VK_NONCONVERT = 0x1D;
michael@0 34 const WIN_VK_ACCEPT = 0x1E;
michael@0 35 const WIN_VK_MODECHANGE = 0x1F;
michael@0 36 const WIN_VK_SPACE = 0x20;
michael@0 37 const WIN_VK_PRIOR = 0x21;
michael@0 38 const WIN_VK_NEXT = 0x22;
michael@0 39 const WIN_VK_END = 0x23;
michael@0 40 const WIN_VK_HOME = 0x24;
michael@0 41 const WIN_VK_LEFT = 0x25;
michael@0 42 const WIN_VK_UP = 0x26;
michael@0 43 const WIN_VK_RIGHT = 0x27;
michael@0 44 const WIN_VK_DOWN = 0x28;
michael@0 45 const WIN_VK_SELECT = 0x29;
michael@0 46 const WIN_VK_PRINT = 0x2A;
michael@0 47 const WIN_VK_EXECUTE = 0x2B;
michael@0 48 const WIN_VK_SNAPSHOT = 0x2C;
michael@0 49 const WIN_VK_INSERT = 0x2D;
michael@0 50 const WIN_VK_DELETE = 0x2E;
michael@0 51 const WIN_VK_HELP = 0x2F;
michael@0 52 const WIN_VK_0 = 0x30;
michael@0 53 const WIN_VK_1 = 0x31;
michael@0 54 const WIN_VK_2 = 0x32;
michael@0 55 const WIN_VK_3 = 0x33;
michael@0 56 const WIN_VK_4 = 0x34;
michael@0 57 const WIN_VK_5 = 0x35;
michael@0 58 const WIN_VK_6 = 0x36;
michael@0 59 const WIN_VK_7 = 0x37;
michael@0 60 const WIN_VK_8 = 0x38;
michael@0 61 const WIN_VK_9 = 0x39;
michael@0 62 const WIN_VK_A = 0x41;
michael@0 63 const WIN_VK_B = 0x42;
michael@0 64 const WIN_VK_C = 0x43;
michael@0 65 const WIN_VK_D = 0x44;
michael@0 66 const WIN_VK_E = 0x45;
michael@0 67 const WIN_VK_F = 0x46;
michael@0 68 const WIN_VK_G = 0x47;
michael@0 69 const WIN_VK_H = 0x48;
michael@0 70 const WIN_VK_I = 0x49;
michael@0 71 const WIN_VK_J = 0x4A;
michael@0 72 const WIN_VK_K = 0x4B;
michael@0 73 const WIN_VK_L = 0x4C;
michael@0 74 const WIN_VK_M = 0x4D;
michael@0 75 const WIN_VK_N = 0x4E;
michael@0 76 const WIN_VK_O = 0x4F;
michael@0 77 const WIN_VK_P = 0x50;
michael@0 78 const WIN_VK_Q = 0x51;
michael@0 79 const WIN_VK_R = 0x52;
michael@0 80 const WIN_VK_S = 0x53;
michael@0 81 const WIN_VK_T = 0x54;
michael@0 82 const WIN_VK_U = 0x55;
michael@0 83 const WIN_VK_V = 0x56;
michael@0 84 const WIN_VK_W = 0x57;
michael@0 85 const WIN_VK_X = 0x58;
michael@0 86 const WIN_VK_Y = 0x59;
michael@0 87 const WIN_VK_Z = 0x5A;
michael@0 88 const WIN_VK_LWIN = 0x5B;
michael@0 89 const WIN_VK_RWIN = 0x5C;
michael@0 90 const WIN_VK_APPS = 0x5D;
michael@0 91 const WIN_VK_SLEEP = 0x5F;
michael@0 92 const WIN_VK_NUMPAD0 = 0x60;
michael@0 93 const WIN_VK_NUMPAD1 = 0x61;
michael@0 94 const WIN_VK_NUMPAD2 = 0x62;
michael@0 95 const WIN_VK_NUMPAD3 = 0x63;
michael@0 96 const WIN_VK_NUMPAD4 = 0x64;
michael@0 97 const WIN_VK_NUMPAD5 = 0x65;
michael@0 98 const WIN_VK_NUMPAD6 = 0x66;
michael@0 99 const WIN_VK_NUMPAD7 = 0x67;
michael@0 100 const WIN_VK_NUMPAD8 = 0x68;
michael@0 101 const WIN_VK_NUMPAD9 = 0x69;
michael@0 102 const WIN_VK_MULTIPLY = 0x6A;
michael@0 103 const WIN_VK_ADD = 0x6B;
michael@0 104 const WIN_VK_SEPARATOR = 0x6C;
michael@0 105 const WIN_VK_OEM_NEC_SEPARATE = 0x6C;
michael@0 106 const WIN_VK_SUBTRACT = 0x6D;
michael@0 107 const WIN_VK_DECIMAL = 0x6E;
michael@0 108 const WIN_VK_DIVIDE = 0x6F;
michael@0 109 const WIN_VK_F1 = 0x70;
michael@0 110 const WIN_VK_F2 = 0x71;
michael@0 111 const WIN_VK_F3 = 0x72;
michael@0 112 const WIN_VK_F4 = 0x73;
michael@0 113 const WIN_VK_F5 = 0x74;
michael@0 114 const WIN_VK_F6 = 0x75;
michael@0 115 const WIN_VK_F7 = 0x76;
michael@0 116 const WIN_VK_F8 = 0x77;
michael@0 117 const WIN_VK_F9 = 0x78;
michael@0 118 const WIN_VK_F10 = 0x79;
michael@0 119 const WIN_VK_F11 = 0x7A;
michael@0 120 const WIN_VK_F12 = 0x7B;
michael@0 121 const WIN_VK_F13 = 0x7C;
michael@0 122 const WIN_VK_F14 = 0x7D;
michael@0 123 const WIN_VK_F15 = 0x7E;
michael@0 124 const WIN_VK_F16 = 0x7F;
michael@0 125 const WIN_VK_F17 = 0x80;
michael@0 126 const WIN_VK_F18 = 0x81;
michael@0 127 const WIN_VK_F19 = 0x82;
michael@0 128 const WIN_VK_F20 = 0x83;
michael@0 129 const WIN_VK_F21 = 0x84;
michael@0 130 const WIN_VK_F22 = 0x85;
michael@0 131 const WIN_VK_F23 = 0x86;
michael@0 132 const WIN_VK_F24 = 0x87;
michael@0 133 const WIN_VK_NUMLOCK = 0x90;
michael@0 134 const WIN_VK_SCROLL = 0x91;
michael@0 135 const WIN_VK_OEM_FJ_JISHO = 0x92;
michael@0 136 const WIN_VK_OEM_NEC_EQUAL = 0x92;
michael@0 137 const WIN_VK_OEM_FJ_MASSHOU = 0x93;
michael@0 138 const WIN_VK_OEM_FJ_TOUROKU = 0x94;
michael@0 139 const WIN_VK_OEM_FJ_LOYA = 0x95;
michael@0 140 const WIN_VK_OEM_FJ_ROYA = 0x96;
michael@0 141 const WIN_VK_LSHIFT = 0xA0;
michael@0 142 const WIN_VK_RSHIFT = 0xA1;
michael@0 143 const WIN_VK_LCONTROL = 0xA2;
michael@0 144 const WIN_VK_RCONTROL = 0xA3;
michael@0 145 const WIN_VK_LMENU = 0xA4;
michael@0 146 const WIN_VK_RMENU = 0xA5;
michael@0 147 const WIN_VK_BROWSER_BACK = 0xA6;
michael@0 148 const WIN_VK_BROWSER_FORWARD = 0xA7;
michael@0 149 const WIN_VK_BROWSER_REFRESH = 0xA8;
michael@0 150 const WIN_VK_BROWSER_STOP = 0xA9;
michael@0 151 const WIN_VK_BROWSER_SEARCH = 0xAA;
michael@0 152 const WIN_VK_BROWSER_FAVORITES = 0xAB;
michael@0 153 const WIN_VK_BROWSER_HOME = 0xAC;
michael@0 154 const WIN_VK_VOLUME_MUTE = 0xAD;
michael@0 155 const WIN_VK_VOLUME_DOWN = 0xAE;
michael@0 156 const WIN_VK_VOLUME_UP = 0xAF;
michael@0 157 const WIN_VK_MEDIA_NEXT_TRACK = 0xB0;
michael@0 158 const WIN_VK_OEM_FJ_000 = 0xB0;
michael@0 159 const WIN_VK_MEDIA_PREV_TRACK = 0xB1;
michael@0 160 const WIN_VK_OEM_FJ_EUQAL = 0xB1;
michael@0 161 const WIN_VK_MEDIA_STOP = 0xB2;
michael@0 162 const WIN_VK_MEDIA_PLAY_PAUSE = 0xB3;
michael@0 163 const WIN_VK_OEM_FJ_00 = 0xB3;
michael@0 164 const WIN_VK_LAUNCH_MAIL = 0xB4;
michael@0 165 const WIN_VK_LAUNCH_MEDIA_SELECT = 0xB5;
michael@0 166 const WIN_VK_LAUNCH_APP1 = 0xB6;
michael@0 167 const WIN_VK_LAUNCH_APP2 = 0xB7;
michael@0 168 const WIN_VK_OEM_1 = 0xBA;
michael@0 169 const WIN_VK_OEM_PLUS = 0xBB;
michael@0 170 const WIN_VK_OEM_COMMA = 0xBC;
michael@0 171 const WIN_VK_OEM_MINUS = 0xBD;
michael@0 172 const WIN_VK_OEM_PERIOD = 0xBE;
michael@0 173 const WIN_VK_OEM_2 = 0xBF;
michael@0 174 const WIN_VK_OEM_3 = 0xC0;
michael@0 175 const WIN_VK_ABNT_C1 = 0xC1;
michael@0 176 const WIN_VK_ABNT_C2 = 0xC2;
michael@0 177 const WIN_VK_OEM_4 = 0xDB;
michael@0 178 const WIN_VK_OEM_5 = 0xDC;
michael@0 179 const WIN_VK_OEM_6 = 0xDD;
michael@0 180 const WIN_VK_OEM_7 = 0xDE;
michael@0 181 const WIN_VK_OEM_8 = 0xDF;
michael@0 182 const WIN_VK_OEM_NEC_DP1 = 0xE0;
michael@0 183 const WIN_VK_OEM_AX = 0xE1;
michael@0 184 const WIN_VK_OEM_NEC_DP2 = 0xE1;
michael@0 185 const WIN_VK_OEM_102 = 0xE2;
michael@0 186 const WIN_VK_OEM_NEC_DP3 = 0xE2;
michael@0 187 const WIN_VK_ICO_HELP = 0xE3;
michael@0 188 const WIN_VK_OEM_NEC_DP4 = 0xE3;
michael@0 189 const WIN_VK_ICO_00 = 0xE4;
michael@0 190 const WIN_VK_PROCESSKEY = 0xE5;
michael@0 191 const WIN_VK_ICO_CLEAR = 0xE6;
michael@0 192 const WIN_VK_PACKET = 0xE7;
michael@0 193 const WIN_VK_ERICSSON_BASE = 0xE8;
michael@0 194 const WIN_VK_OEM_RESET = 0xE9;
michael@0 195 const WIN_VK_OEM_JUMP = 0xEA;
michael@0 196 const WIN_VK_OEM_PA1 = 0xEB;
michael@0 197 const WIN_VK_OEM_PA2 = 0xEC;
michael@0 198 const WIN_VK_OEM_PA3 = 0xED;
michael@0 199 const WIN_VK_OEM_WSCTRL = 0xEE;
michael@0 200 const WIN_VK_OEM_CUSEL = 0xEF;
michael@0 201 const WIN_VK_OEM_ATTN = 0xF0;
michael@0 202 const WIN_VK_OEM_FINISH = 0xF1;
michael@0 203 const WIN_VK_OEM_COPY = 0xF2;
michael@0 204 const WIN_VK_OEM_AUTO = 0xF3;
michael@0 205 const WIN_VK_OEM_ENLW = 0xF4;
michael@0 206 const WIN_VK_OEM_BACKTAB = 0xF5;
michael@0 207 const WIN_VK_ATTN = 0xF6;
michael@0 208 const WIN_VK_CRSEL = 0xF7;
michael@0 209 const WIN_VK_EXSEL = 0xF8;
michael@0 210 const WIN_VK_EREOF = 0xF9;
michael@0 211 const WIN_VK_PLAY = 0xFA;
michael@0 212 const WIN_VK_ZOOM = 0xFB;
michael@0 213 const WIN_VK_NONAME = 0xFC;
michael@0 214 const WIN_VK_PA1 = 0xFD;
michael@0 215 const WIN_VK_OEM_CLEAR = 0xFE;
michael@0 216
michael@0 217 // Mac
michael@0 218
michael@0 219 const MAC_VK_ANSI_A = 0x00;
michael@0 220 const MAC_VK_ANSI_S = 0x01;
michael@0 221 const MAC_VK_ANSI_D = 0x02;
michael@0 222 const MAC_VK_ANSI_F = 0x03;
michael@0 223 const MAC_VK_ANSI_H = 0x04;
michael@0 224 const MAC_VK_ANSI_G = 0x05;
michael@0 225 const MAC_VK_ANSI_Z = 0x06;
michael@0 226 const MAC_VK_ANSI_X = 0x07;
michael@0 227 const MAC_VK_ANSI_C = 0x08;
michael@0 228 const MAC_VK_ANSI_V = 0x09;
michael@0 229 const MAC_VK_ISO_Section = 0x0A;
michael@0 230 const MAC_VK_ANSI_B = 0x0B;
michael@0 231 const MAC_VK_ANSI_Q = 0x0C;
michael@0 232 const MAC_VK_ANSI_W = 0x0D;
michael@0 233 const MAC_VK_ANSI_E = 0x0E;
michael@0 234 const MAC_VK_ANSI_R = 0x0F;
michael@0 235 const MAC_VK_ANSI_Y = 0x10;
michael@0 236 const MAC_VK_ANSI_T = 0x11;
michael@0 237 const MAC_VK_ANSI_1 = 0x12;
michael@0 238 const MAC_VK_ANSI_2 = 0x13;
michael@0 239 const MAC_VK_ANSI_3 = 0x14;
michael@0 240 const MAC_VK_ANSI_4 = 0x15;
michael@0 241 const MAC_VK_ANSI_6 = 0x16;
michael@0 242 const MAC_VK_ANSI_5 = 0x17;
michael@0 243 const MAC_VK_ANSI_Equal = 0x18;
michael@0 244 const MAC_VK_ANSI_9 = 0x19;
michael@0 245 const MAC_VK_ANSI_7 = 0x1A;
michael@0 246 const MAC_VK_ANSI_Minus = 0x1B;
michael@0 247 const MAC_VK_ANSI_8 = 0x1C;
michael@0 248 const MAC_VK_ANSI_0 = 0x1D;
michael@0 249 const MAC_VK_ANSI_RightBracket = 0x1E;
michael@0 250 const MAC_VK_ANSI_O = 0x1F;
michael@0 251 const MAC_VK_ANSI_U = 0x20;
michael@0 252 const MAC_VK_ANSI_LeftBracket = 0x21;
michael@0 253 const MAC_VK_ANSI_I = 0x22;
michael@0 254 const MAC_VK_ANSI_P = 0x23;
michael@0 255 const MAC_VK_Return = 0x24;
michael@0 256 const MAC_VK_ANSI_L = 0x25;
michael@0 257 const MAC_VK_ANSI_J = 0x26;
michael@0 258 const MAC_VK_ANSI_Quote = 0x27;
michael@0 259 const MAC_VK_ANSI_K = 0x28;
michael@0 260 const MAC_VK_ANSI_Semicolon = 0x29;
michael@0 261 const MAC_VK_ANSI_Backslash = 0x2A;
michael@0 262 const MAC_VK_ANSI_Comma = 0x2B;
michael@0 263 const MAC_VK_ANSI_Slash = 0x2C;
michael@0 264 const MAC_VK_ANSI_N = 0x2D;
michael@0 265 const MAC_VK_ANSI_M = 0x2E;
michael@0 266 const MAC_VK_ANSI_Period = 0x2F;
michael@0 267 const MAC_VK_Tab = 0x30;
michael@0 268 const MAC_VK_Space = 0x31;
michael@0 269 const MAC_VK_ANSI_Grave = 0x32;
michael@0 270 const MAC_VK_Delete = 0x33;
michael@0 271 const MAC_VK_PC_Backspace = 0x33;
michael@0 272 const MAC_VK_Powerbook_KeypadEnter = 0x34;
michael@0 273 const MAC_VK_Escape = 0x35;
michael@0 274 const MAC_VK_RightCommand = 0x36;
michael@0 275 const MAC_VK_Command = 0x37;
michael@0 276 const MAC_VK_Shift = 0x38;
michael@0 277 const MAC_VK_CapsLock = 0x39;
michael@0 278 const MAC_VK_Option = 0x3A;
michael@0 279 const MAC_VK_Control = 0x3B;
michael@0 280 const MAC_VK_RightShift = 0x3C;
michael@0 281 const MAC_VK_RightOption = 0x3D;
michael@0 282 const MAC_VK_RightControl = 0x3E;
michael@0 283 const MAC_VK_Function = 0x3F;
michael@0 284 const MAC_VK_F17 = 0x40;
michael@0 285 const MAC_VK_ANSI_KeypadDecimal = 0x41;
michael@0 286 const MAC_VK_ANSI_KeypadMultiply = 0x43;
michael@0 287 const MAC_VK_ANSI_KeypadPlus = 0x45;
michael@0 288 const MAC_VK_ANSI_KeypadClear = 0x47;
michael@0 289 const MAC_VK_VolumeUp = 0x48;
michael@0 290 const MAC_VK_VolumeDown = 0x49;
michael@0 291 const MAC_VK_Mute = 0x4A;
michael@0 292 const MAC_VK_ANSI_KeypadDivide = 0x4B;
michael@0 293 const MAC_VK_ANSI_KeypadEnter = 0x4C;
michael@0 294 const MAC_VK_ANSI_KeypadMinus = 0x4E;
michael@0 295 const MAC_VK_F18 = 0x4F;
michael@0 296 const MAC_VK_F19 = 0x50;
michael@0 297 const MAC_VK_ANSI_KeypadEquals = 0x51;
michael@0 298 const MAC_VK_ANSI_Keypad0 = 0x52;
michael@0 299 const MAC_VK_ANSI_Keypad1 = 0x53;
michael@0 300 const MAC_VK_ANSI_Keypad2 = 0x54;
michael@0 301 const MAC_VK_ANSI_Keypad3 = 0x55;
michael@0 302 const MAC_VK_ANSI_Keypad4 = 0x56;
michael@0 303 const MAC_VK_ANSI_Keypad5 = 0x57;
michael@0 304 const MAC_VK_ANSI_Keypad6 = 0x58;
michael@0 305 const MAC_VK_ANSI_Keypad7 = 0x59;
michael@0 306 const MAC_VK_F20 = 0x5A;
michael@0 307 const MAC_VK_ANSI_Keypad8 = 0x5B;
michael@0 308 const MAC_VK_ANSI_Keypad9 = 0x5C;
michael@0 309 const MAC_VK_JIS_Yen = 0x5D;
michael@0 310 const MAC_VK_JIS_Underscore = 0x5E;
michael@0 311 const MAC_VK_JIS_KeypadComma = 0x5F;
michael@0 312 const MAC_VK_F5 = 0x60;
michael@0 313 const MAC_VK_F6 = 0x61;
michael@0 314 const MAC_VK_F7 = 0x62;
michael@0 315 const MAC_VK_F3 = 0x63;
michael@0 316 const MAC_VK_F8 = 0x64;
michael@0 317 const MAC_VK_F9 = 0x65;
michael@0 318 const MAC_VK_JIS_Eisu = 0x66;
michael@0 319 const MAC_VK_F11 = 0x67;
michael@0 320 const MAC_VK_JIS_Kana = 0x68;
michael@0 321 const MAC_VK_F13 = 0x69;
michael@0 322 const MAC_VK_PC_PrintScreen = 0x69;
michael@0 323 const MAC_VK_F16 = 0x6A;
michael@0 324 const MAC_VK_PC_ScrollLock = 0x6A;
michael@0 325 const MAC_VK_F14 = 0x6B;
michael@0 326 const MAC_VK_PC_Pause = 0x6B;
michael@0 327 const MAC_VK_F10 = 0x6D;
michael@0 328 const MAC_VK_PC_ContextMenu = 0x6E;
michael@0 329 const MAC_VK_F12 = 0x6F;
michael@0 330 const MAC_VK_F15 = 0x71;
michael@0 331 const MAC_VK_Help = 0x72;
michael@0 332 const MAC_VK_PC_Insert = 0x72;
michael@0 333 const MAC_VK_Home = 0x73;
michael@0 334 const MAC_VK_PageUp = 0x74;
michael@0 335 const MAC_VK_ForwardDelete = 0x75;
michael@0 336 const MAC_VK_PC_Delete = 0x75;
michael@0 337 const MAC_VK_F4 = 0x76;
michael@0 338 const MAC_VK_End = 0x77;
michael@0 339 const MAC_VK_F2 = 0x78;
michael@0 340 const MAC_VK_PageDown = 0x79;
michael@0 341 const MAC_VK_F1 = 0x7A;
michael@0 342 const MAC_VK_LeftArrow = 0x7B;
michael@0 343 const MAC_VK_RightArrow = 0x7C;
michael@0 344 const MAC_VK_DownArrow = 0x7D;
michael@0 345 const MAC_VK_UpArrow = 0x7E;
michael@0 346

mercurial