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: // http://www.w3.org/TR/1999/WD-DOM-Level-2-19990923/events.html#Events-KeyEvent michael@0: interface KeyEvent michael@0: { michael@0: const unsigned long DOM_VK_CANCEL = 0x03; michael@0: const unsigned long DOM_VK_HELP = 0x06; michael@0: const unsigned long DOM_VK_BACK_SPACE = 0x08; michael@0: const unsigned long DOM_VK_TAB = 0x09; michael@0: const unsigned long DOM_VK_CLEAR = 0x0C; michael@0: const unsigned long DOM_VK_RETURN = 0x0D; michael@0: // DOM_VK_ENTER has been never used for representing native key events. michael@0: // Therefore, it's removed for preventing developers being confused. michael@0: // const unsigned long DOM_VK_ENTER = 0x0E; michael@0: const unsigned long DOM_VK_SHIFT = 0x10; michael@0: const unsigned long DOM_VK_CONTROL = 0x11; michael@0: const unsigned long DOM_VK_ALT = 0x12; michael@0: const unsigned long DOM_VK_PAUSE = 0x13; michael@0: const unsigned long DOM_VK_CAPS_LOCK = 0x14; michael@0: const unsigned long DOM_VK_KANA = 0x15; michael@0: const unsigned long DOM_VK_HANGUL = 0x15; michael@0: const unsigned long DOM_VK_EISU = 0x16; // Japanese Mac keyboard only michael@0: const unsigned long DOM_VK_JUNJA = 0x17; michael@0: const unsigned long DOM_VK_FINAL = 0x18; michael@0: const unsigned long DOM_VK_HANJA = 0x19; michael@0: const unsigned long DOM_VK_KANJI = 0x19; michael@0: const unsigned long DOM_VK_ESCAPE = 0x1B; michael@0: const unsigned long DOM_VK_CONVERT = 0x1C; michael@0: const unsigned long DOM_VK_NONCONVERT = 0x1D; michael@0: const unsigned long DOM_VK_ACCEPT = 0x1E; michael@0: const unsigned long DOM_VK_MODECHANGE = 0x1F; michael@0: const unsigned long DOM_VK_SPACE = 0x20; michael@0: const unsigned long DOM_VK_PAGE_UP = 0x21; michael@0: const unsigned long DOM_VK_PAGE_DOWN = 0x22; michael@0: const unsigned long DOM_VK_END = 0x23; michael@0: const unsigned long DOM_VK_HOME = 0x24; michael@0: const unsigned long DOM_VK_LEFT = 0x25; michael@0: const unsigned long DOM_VK_UP = 0x26; michael@0: const unsigned long DOM_VK_RIGHT = 0x27; michael@0: const unsigned long DOM_VK_DOWN = 0x28; michael@0: const unsigned long DOM_VK_SELECT = 0x29; michael@0: const unsigned long DOM_VK_PRINT = 0x2A; michael@0: const unsigned long DOM_VK_EXECUTE = 0x2B; michael@0: const unsigned long DOM_VK_PRINTSCREEN = 0x2C; michael@0: const unsigned long DOM_VK_INSERT = 0x2D; michael@0: const unsigned long DOM_VK_DELETE = 0x2E; michael@0: michael@0: // DOM_VK_0 - DOM_VK_9 match their ascii values michael@0: const unsigned long DOM_VK_0 = 0x30; michael@0: const unsigned long DOM_VK_1 = 0x31; michael@0: const unsigned long DOM_VK_2 = 0x32; michael@0: const unsigned long DOM_VK_3 = 0x33; michael@0: const unsigned long DOM_VK_4 = 0x34; michael@0: const unsigned long DOM_VK_5 = 0x35; michael@0: const unsigned long DOM_VK_6 = 0x36; michael@0: const unsigned long DOM_VK_7 = 0x37; michael@0: const unsigned long DOM_VK_8 = 0x38; michael@0: const unsigned long DOM_VK_9 = 0x39; michael@0: michael@0: const unsigned long DOM_VK_COLON = 0x3A; michael@0: const unsigned long DOM_VK_SEMICOLON = 0x3B; michael@0: const unsigned long DOM_VK_LESS_THAN = 0x3C; michael@0: const unsigned long DOM_VK_EQUALS = 0x3D; michael@0: const unsigned long DOM_VK_GREATER_THAN = 0x3E; michael@0: const unsigned long DOM_VK_QUESTION_MARK = 0x3F; michael@0: const unsigned long DOM_VK_AT = 0x40; michael@0: michael@0: // DOM_VK_A - DOM_VK_Z match their ascii values michael@0: const unsigned long DOM_VK_A = 0x41; michael@0: const unsigned long DOM_VK_B = 0x42; michael@0: const unsigned long DOM_VK_C = 0x43; michael@0: const unsigned long DOM_VK_D = 0x44; michael@0: const unsigned long DOM_VK_E = 0x45; michael@0: const unsigned long DOM_VK_F = 0x46; michael@0: const unsigned long DOM_VK_G = 0x47; michael@0: const unsigned long DOM_VK_H = 0x48; michael@0: const unsigned long DOM_VK_I = 0x49; michael@0: const unsigned long DOM_VK_J = 0x4A; michael@0: const unsigned long DOM_VK_K = 0x4B; michael@0: const unsigned long DOM_VK_L = 0x4C; michael@0: const unsigned long DOM_VK_M = 0x4D; michael@0: const unsigned long DOM_VK_N = 0x4E; michael@0: const unsigned long DOM_VK_O = 0x4F; michael@0: const unsigned long DOM_VK_P = 0x50; michael@0: const unsigned long DOM_VK_Q = 0x51; michael@0: const unsigned long DOM_VK_R = 0x52; michael@0: const unsigned long DOM_VK_S = 0x53; michael@0: const unsigned long DOM_VK_T = 0x54; michael@0: const unsigned long DOM_VK_U = 0x55; michael@0: const unsigned long DOM_VK_V = 0x56; michael@0: const unsigned long DOM_VK_W = 0x57; michael@0: const unsigned long DOM_VK_X = 0x58; michael@0: const unsigned long DOM_VK_Y = 0x59; michael@0: const unsigned long DOM_VK_Z = 0x5A; michael@0: michael@0: const unsigned long DOM_VK_WIN = 0x5B; michael@0: const unsigned long DOM_VK_CONTEXT_MENU = 0x5D; michael@0: const unsigned long DOM_VK_SLEEP = 0x5F; michael@0: michael@0: // Numpad keys michael@0: const unsigned long DOM_VK_NUMPAD0 = 0x60; michael@0: const unsigned long DOM_VK_NUMPAD1 = 0x61; michael@0: const unsigned long DOM_VK_NUMPAD2 = 0x62; michael@0: const unsigned long DOM_VK_NUMPAD3 = 0x63; michael@0: const unsigned long DOM_VK_NUMPAD4 = 0x64; michael@0: const unsigned long DOM_VK_NUMPAD5 = 0x65; michael@0: const unsigned long DOM_VK_NUMPAD6 = 0x66; michael@0: const unsigned long DOM_VK_NUMPAD7 = 0x67; michael@0: const unsigned long DOM_VK_NUMPAD8 = 0x68; michael@0: const unsigned long DOM_VK_NUMPAD9 = 0x69; michael@0: const unsigned long DOM_VK_MULTIPLY = 0x6A; michael@0: const unsigned long DOM_VK_ADD = 0x6B; michael@0: const unsigned long DOM_VK_SEPARATOR = 0x6C; michael@0: const unsigned long DOM_VK_SUBTRACT = 0x6D; michael@0: const unsigned long DOM_VK_DECIMAL = 0x6E; michael@0: const unsigned long DOM_VK_DIVIDE = 0x6F; michael@0: michael@0: const unsigned long DOM_VK_F1 = 0x70; michael@0: const unsigned long DOM_VK_F2 = 0x71; michael@0: const unsigned long DOM_VK_F3 = 0x72; michael@0: const unsigned long DOM_VK_F4 = 0x73; michael@0: const unsigned long DOM_VK_F5 = 0x74; michael@0: const unsigned long DOM_VK_F6 = 0x75; michael@0: const unsigned long DOM_VK_F7 = 0x76; michael@0: const unsigned long DOM_VK_F8 = 0x77; michael@0: const unsigned long DOM_VK_F9 = 0x78; michael@0: const unsigned long DOM_VK_F10 = 0x79; michael@0: const unsigned long DOM_VK_F11 = 0x7A; michael@0: const unsigned long DOM_VK_F12 = 0x7B; michael@0: const unsigned long DOM_VK_F13 = 0x7C; michael@0: const unsigned long DOM_VK_F14 = 0x7D; michael@0: const unsigned long DOM_VK_F15 = 0x7E; michael@0: const unsigned long DOM_VK_F16 = 0x7F; michael@0: const unsigned long DOM_VK_F17 = 0x80; michael@0: const unsigned long DOM_VK_F18 = 0x81; michael@0: const unsigned long DOM_VK_F19 = 0x82; michael@0: const unsigned long DOM_VK_F20 = 0x83; michael@0: const unsigned long DOM_VK_F21 = 0x84; michael@0: const unsigned long DOM_VK_F22 = 0x85; michael@0: const unsigned long DOM_VK_F23 = 0x86; michael@0: const unsigned long DOM_VK_F24 = 0x87; michael@0: michael@0: const unsigned long DOM_VK_NUM_LOCK = 0x90; michael@0: const unsigned long DOM_VK_SCROLL_LOCK = 0x91; michael@0: michael@0: // OEM specific virtual keyCode of Windows should pass through DOM keyCode michael@0: // for compatibility with the other web browsers on Windows. michael@0: const unsigned long DOM_VK_WIN_OEM_FJ_JISHO = 0x92; michael@0: const unsigned long DOM_VK_WIN_OEM_FJ_MASSHOU = 0x93; michael@0: const unsigned long DOM_VK_WIN_OEM_FJ_TOUROKU = 0x94; michael@0: const unsigned long DOM_VK_WIN_OEM_FJ_LOYA = 0x95; michael@0: const unsigned long DOM_VK_WIN_OEM_FJ_ROYA = 0x96; michael@0: michael@0: const unsigned long DOM_VK_CIRCUMFLEX = 0xA0; michael@0: const unsigned long DOM_VK_EXCLAMATION = 0xA1; michael@0: const unsigned long DOM_VK_DOUBLE_QUOTE = 0xA2; michael@0: const unsigned long DOM_VK_HASH = 0xA3; michael@0: const unsigned long DOM_VK_DOLLAR = 0xA4; michael@0: const unsigned long DOM_VK_PERCENT = 0xA5; michael@0: const unsigned long DOM_VK_AMPERSAND = 0xA6; michael@0: const unsigned long DOM_VK_UNDERSCORE = 0xA7; michael@0: const unsigned long DOM_VK_OPEN_PAREN = 0xA8; michael@0: const unsigned long DOM_VK_CLOSE_PAREN = 0xA9; michael@0: const unsigned long DOM_VK_ASTERISK = 0xAA; michael@0: const unsigned long DOM_VK_PLUS = 0xAB; michael@0: const unsigned long DOM_VK_PIPE = 0xAC; michael@0: const unsigned long DOM_VK_HYPHEN_MINUS = 0xAD; michael@0: michael@0: const unsigned long DOM_VK_OPEN_CURLY_BRACKET = 0xAE; michael@0: const unsigned long DOM_VK_CLOSE_CURLY_BRACKET = 0xAF; michael@0: michael@0: const unsigned long DOM_VK_TILDE = 0xB0; michael@0: michael@0: const unsigned long DOM_VK_VOLUME_MUTE = 0xB5; michael@0: const unsigned long DOM_VK_VOLUME_DOWN = 0xB6; michael@0: const unsigned long DOM_VK_VOLUME_UP = 0xB7; michael@0: michael@0: const unsigned long DOM_VK_COMMA = 0xBC; michael@0: const unsigned long DOM_VK_PERIOD = 0xBE; michael@0: const unsigned long DOM_VK_SLASH = 0xBF; michael@0: const unsigned long DOM_VK_BACK_QUOTE = 0xC0; michael@0: const unsigned long DOM_VK_OPEN_BRACKET = 0xDB; // square bracket michael@0: const unsigned long DOM_VK_BACK_SLASH = 0xDC; michael@0: const unsigned long DOM_VK_CLOSE_BRACKET = 0xDD; // square bracket michael@0: const unsigned long DOM_VK_QUOTE = 0xDE; // Apostrophe michael@0: michael@0: const unsigned long DOM_VK_META = 0xE0; michael@0: const unsigned long DOM_VK_ALTGR = 0xE1; michael@0: michael@0: // OEM specific virtual keyCode of Windows should pass through DOM keyCode michael@0: // for compatibility with the other web browsers on Windows. michael@0: const unsigned long DOM_VK_WIN_ICO_HELP = 0xE3; michael@0: const unsigned long DOM_VK_WIN_ICO_00 = 0xE4; michael@0: const unsigned long DOM_VK_WIN_ICO_CLEAR = 0xE6; michael@0: const unsigned long DOM_VK_WIN_OEM_RESET = 0xE9; michael@0: const unsigned long DOM_VK_WIN_OEM_JUMP = 0xEA; michael@0: const unsigned long DOM_VK_WIN_OEM_PA1 = 0xEB; michael@0: const unsigned long DOM_VK_WIN_OEM_PA2 = 0xEC; michael@0: const unsigned long DOM_VK_WIN_OEM_PA3 = 0xED; michael@0: const unsigned long DOM_VK_WIN_OEM_WSCTRL = 0xEE; michael@0: const unsigned long DOM_VK_WIN_OEM_CUSEL = 0xEF; michael@0: const unsigned long DOM_VK_WIN_OEM_ATTN = 0xF0; michael@0: const unsigned long DOM_VK_WIN_OEM_FINISH = 0xF1; michael@0: const unsigned long DOM_VK_WIN_OEM_COPY = 0xF2; michael@0: const unsigned long DOM_VK_WIN_OEM_AUTO = 0xF3; michael@0: const unsigned long DOM_VK_WIN_OEM_ENLW = 0xF4; michael@0: const unsigned long DOM_VK_WIN_OEM_BACKTAB = 0xF5; michael@0: michael@0: // Following keys are not used on most keyboards. However, for compatibility michael@0: // with other browsers on Windows, we should define them. michael@0: const unsigned long DOM_VK_ATTN = 0xF6; michael@0: const unsigned long DOM_VK_CRSEL = 0xF7; michael@0: const unsigned long DOM_VK_EXSEL = 0xF8; michael@0: const unsigned long DOM_VK_EREOF = 0xF9; michael@0: const unsigned long DOM_VK_PLAY = 0xFA; michael@0: const unsigned long DOM_VK_ZOOM = 0xFB; michael@0: const unsigned long DOM_VK_PA1 = 0xFD; michael@0: michael@0: // OEM specific virtual keyCode of Windows should pass through DOM keyCode michael@0: // for compatibility with the other web browsers on Windows. michael@0: const unsigned long DOM_VK_WIN_OEM_CLEAR = 0xFE; michael@0: michael@0: [Throws] michael@0: void initKeyEvent(DOMString type, michael@0: boolean canBubble, michael@0: boolean cancelable, michael@0: WindowProxy? view, michael@0: boolean ctrlKey, michael@0: boolean altKey, michael@0: boolean shiftKey, michael@0: boolean metaKey, michael@0: unsigned long keyCode, michael@0: unsigned long charCode); michael@0: };