Index: ui/events/keycodes/dom3/dom_code.h |
diff --git a/ui/events/keycodes/dom3/dom_code.h b/ui/events/keycodes/dom3/dom_code.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..fd0d3d3a74695b08adbe87915c2f48323c42a0a0 |
--- /dev/null |
+++ b/ui/events/keycodes/dom3/dom_code.h |
@@ -0,0 +1,270 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_EVENTS_KEYCODES_DOM3_DOM_CODE_H_ |
+#define UI_EVENTS_KEYCODES_DOM3_DOM_CODE_H_ |
+ |
+// DOM Level 3 .code value enumeration constants, as defined by: |
+// |
+// [0] DOM Level 3 KeyboardEvent code Values, |
+// http://www.w3.org/TR/DOM-Level-3-Events-code/ |
+// |
+// That reference should be consulted on the meaning and usage of these |
+// values; this file does not attempt to describe that. |
+// |
+// Additional references: |
+// |
+// [1] Document Object Model (DOM) Level 3 Events Specification, |
+// http://www.w3.org/TR/DOM-Level-3-Events/ |
+// [2] DOM Level 3 KeyboardEvent key Values, |
+// http://www.w3.org/TR/DOM-Level-3-Events-key/ |
+// [3] Legacy Keyboard Event Properties, |
+// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/Note-KeyProps.html |
+// [4] USB HID Usage Tables, |
+// http://www.usb.org/developers/devclass_docs/Hut1_11.pdf |
+// [5] Linux <linux/evdev.h> |
+// [6] Windows <ime.h> and <winuser.h> |
+// [7] OS X <HIToolbox/Events.h> |
+// |
+// DOM3 values are defined as text, but numeric values (enum constants) are |
+// useful internally, e.g. for IPC or rapid dispatch. The numeric values |
+// are chosen to correspond to the USB codes ((PageID << 16) | UsageID) |
+// and the comments below indicate the USB name as well as the DOM3 name. |
+// Non-USB codes use page 0. |
+// |
+// The enum identifiers are systematically derived from the DOM names by |
+// inserting an underscore between consecutive 'words' and converting to |
+// upper case. |
+// |
+// This file is organized following the sections of the W3C document [0]. |
+// |
+// When adding a value, be sure to add the DOM name to the string table |
+// in keycode_converter.cc as well, and the USB and platform scan codes |
+// to keycode_converter_data.h. |
+ |
+namespace ui { |
+ |
+enum class DomCode { |
+ // Zero is reserved to mean no value; there is no corresponding DOM string. |
+ NONE = 0x0000, |
+ |
+ // Writing System Keys |
+ // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-alphanumeric-writing-system |
+ BACKQUOTE = 0x070035, // Backquote; ` and ~ |
+ BACKSLASH = 0x070031, // Backslash; \\ and | |
+ BACKSPACE = 0x07002A, // Backspace; Backspace |
+ BRACKET_LEFT = 0x07002F, // BracketLeft; [ and { |
+ BRACKET_RIGHT = 0x070030, // BracketRight; ] and } |
+ COMMA = 0x070036, // Comma; , and < |
+ DIGIT0 = 0x070027, // Digit0; 0 and ) |
+ DIGIT1 = 0x07001E, // Digit1; 1 and ! |
+ DIGIT2 = 0x07001F, // Digit2; 2 and @ |
+ DIGIT3 = 0x070020, // Digit3; 3 and # |
+ DIGIT4 = 0x070021, // Digit4; 4 and $ |
+ DIGIT5 = 0x070022, // Digit5; 5 and % |
+ DIGIT6 = 0x070023, // Digit6; 6 and ^ |
+ DIGIT7 = 0x070024, // Digit7; 7 and & |
+ DIGIT8 = 0x070025, // Digit8; 8 and * |
+ DIGIT9 = 0x070026, // Digit9; 9 and ( |
+ EQUAL = 0x07002E, // Equal; = and + |
+ INTL_BACKSLASH = 0x070064, // IntlBackslash; Non-US \\ and | |
+ INTL_HASH = 0x070032, // IntlHash; # and ~ |
+ INTL_RO = 0x070087, // IntlRo; Non-US / and ? |
+ INTL_YEN = 0x070089, // IntlYen; International3 |
+ KEY_A = 0x070004, // KeyA; a and A |
+ KEY_B = 0x070005, // KeyB; b and B |
+ KEY_C = 0x070006, // KeyC; c and C |
+ KEY_D = 0x070007, // KeyD; d and D |
+ KEY_E = 0x070008, // KeyE; e and E |
+ KEY_F = 0x070009, // KeyF; f and F |
+ KEY_G = 0x07000A, // KeyG; g and G |
+ KEY_H = 0x07000B, // KeyH; h and H |
+ KEY_I = 0x07000C, // KeyI; i and I |
+ KEY_J = 0x07000D, // KeyJ; j and J |
+ KEY_K = 0x07000E, // KeyK; k and K |
+ KEY_L = 0x07000F, // KeyL; l and L |
+ KEY_M = 0x070010, // KeyM; m and M |
+ KEY_N = 0x070011, // KeyN; n and N |
+ KEY_O = 0x070012, // KeyO; o and O |
+ KEY_P = 0x070013, // KeyP; p and P |
+ KEY_Q = 0x070014, // KeyQ; q and Q |
+ KEY_R = 0x070015, // KeyR; r and R |
+ KEY_S = 0x070016, // KeyS; s and S |
+ KEY_T = 0x070017, // KeyT; t and T |
+ KEY_U = 0x070018, // KeyU; u and U |
+ KEY_V = 0x070019, // KeyV; v and V |
+ KEY_W = 0x07001A, // KeyW; w and W |
+ KEY_X = 0x07001B, // KeyX; x and X |
+ KEY_Y = 0x07001C, // KeyY; y and Y |
+ KEY_Z = 0x07001D, // KeyZ; z and Z |
+ MINUS = 0x07002D, // Minus; - and _ |
+ PERIOD = 0x070037, // Period; . and > |
+ QUOTE = 0x070034, // Quote; $A and $B |
+ SEMICOLON = 0x070033, // Semicolon; ; and : |
+ SLASH = 0x070038, // Slash; / and ? |
+ |
+ // 2.1.1.2 Functional Keys |
+ // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-alphanumeric-functional |
+ ALT_LEFT = 0x0700E2, // AltLeft; Left Alt (Meta) |
+ ALT_RIGHT = 0x0700E6, // AltRight; Right Alt (Meta) |
+ CAPS_LOCK = 0x070039, // CapsLock; Caps Lock |
+ CONTEXT_MENU = 0x070065, // ContextMenu; Application (Compose) |
+ CONTROL_LEFT = 0x0700E0, // ControlLeft; Left Control |
+ CONTROL_RIGHT = 0x0700E4, // ControlRight; Right Control |
+ ENTER = 0x070028, // Enter; Return (ENTER) |
+ OS_LEFT = 0x0700E3, // OSLeft; Left GUI (Command, Win) |
+ OS_RIGHT = 0x0700E7, // OSRight; Right GUI (Command, Win) |
+ SHIFT_LEFT = 0x0700E1, // ShiftLeft; Left Shift |
+ SHIFT_RIGHT = 0x0700E5, // ShiftRight; Right Shift |
+ SPACE = 0x07002C, // Space; Spacebar |
+ TAB = 0x07002B, // Tab; Tab |
+ |
+ CONVERT = 0x07008A, // Convert; International4 |
+ KANA_MODE = 0x070088, // KanaMode; International2 |
+ LANG1 = 0x070090, // Lang1; LANG1 (Hangul/English) |
+ LANG2 = 0x070091, // Lang2; LANG2 (Hanja) |
+ LANG3 = 0x070092, // Lang3; LANG3 (Katakana) |
+ LANG4 = 0x070093, // Lang4; LANG4 (Hiragana) |
+ LANG5 = 0x070094, // Lang5; LANG5 (Zenkaku/Henkaku) |
+ NON_CONVERT = 0x07008B, // NonConvert; International5 |
+ |
+ // 2.1.2 Control Pad Section |
+ // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-controlpad-section |
+ DELETE = 0x07004C, // Delete; Delete Forward (DEL) |
+ END = 0x07004D, // End; End |
+ HELP = 0x070075, // Help; Help |
+ HOME = 0x07004A, // Home; Home |
+ INSERT = 0x070049, // Insert; Insert |
+ PAGE_DOWN = 0x07004E, // PageDown; PageDown |
+ PAGE_UP = 0x07004B, // PageUp; PageUp |
+ |
+ // 2.1.3 Arrow Pad Section |
+ // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-arrowpad-section |
+ ARROW_DOWN = 0x070051, // ArrowDown; DownArrow |
+ ARROW_LEFT = 0x070050, // ArrowLeft; LeftArrow |
+ ARROW_RIGHT = 0x07004F, // ArrowRight; RightArrow |
+ ARROW_UP = 0x070052, // ArrowUp; UpArrow |
+ |
+ // 2.1.4 Numpad Section |
+ // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-numpad-section |
+ NUM_LOCK = 0x070053, // NumLock; Keypad Num Lock and Clear |
+ NUMPAD0 = 0x070062, // Numpad0; Keypad 0 and Insert |
+ NUMPAD1 = 0x070059, // Numpad1; Keypad 1 and End |
+ NUMPAD2 = 0x07005A, // Numpad2; Keypad 2 and Down Arrow |
+ NUMPAD3 = 0x07005B, // Numpad3; Keypad 3 and PageDn |
+ NUMPAD4 = 0x07005C, // Numpad4; Keypad 4 and Left Arrow |
+ NUMPAD5 = 0x07005D, // Numpad5; Keypad 5 |
+ NUMPAD6 = 0x07005E, // Numpad6; Keypad 6 and Right Arrow |
+ NUMPAD7 = 0x07005F, // Numpad7; Keypad 7 and Home |
+ NUMPAD8 = 0x070060, // Numpad8; Keypad 8 and Up Arrow |
+ NUMPAD9 = 0x070061, // Numpad9; Keypad 9 and PageUp |
+ NUMPAD_ADD = 0x070057, // NumpadAdd; Keypad + |
+ NUMPAD_BACKSPACE = 0x0700BB, // NumpadBackspace; Keypad Backspace |
+ NUMPAD_CLEAR = 0x0700D8, // NumpadClear; Keypad Clear |
+ NUMPAD_CLEAR_ENTRY = 0x0700D9, // NumpadClearEntry; Keypad Clear Entry |
+ NUMPAD_COMMA = 0x070085, // NumpadComma; Keypad Comma |
+ NUMPAD_DECIMAL = 0x070063, // NumpadDecimal; Keypad . and Delete |
+ NUMPAD_DIVIDE = 0x070054, // NumpadDivide; Keypad / |
+ NUMPAD_ENTER = 0x070058, // NumpadEnter; Keypad ENTER |
+ NUMPAD_EQUAL = 0x070067, // NumpadEqual; Keypad = |
+ NUMPAD_MEMORY_ADD = 0x0700D3, // NumpadMemoryAdd; Keypad Memory Add |
+ NUMPAD_MEMORY_CLEAR = 0x0700D2, // NumpadMemoryClear; Keypad Memory Clear |
+ NUMPAD_MEMORY_RECALL = 0x0700D1, // NumpadMemoryRecall; Keypad Memory Recall |
+ NUMPAD_MEMORY_STORE = 0x0700D0, // NumpadMemoryStore; Keypad Memory Store |
+ NUMPAD_MEMORY_SUBTRACT = 0x0700D4, // NumpadMemorySubtract; |
+ // Keypad Memory Subtract |
+ NUMPAD_MULTIPLY = 0x070055, // NumpadMultiply; Keypad * |
+ NUMPAD_PAREN_LEFT = 0x0700B6, // NumpadParenLeft; Keypad ( |
+ NUMPAD_PAREN_RIGHT = 0x0700B7, // NumpadParenRight; Keypad ) |
+ NUMPAD_SUBTRACT = 0x070056, // NumpadSubtract; Keypad - |
+ |
+ // 2.1.5 Function Section |
+ // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-function-section |
+ ESCAPE = 0x070029, // Escape; Escape |
+ F1 = 0x07003A, // F1; F1 |
+ F2 = 0x07003B, // F2; F2 |
+ F3 = 0x07003C, // F3; F3 |
+ F4 = 0x07003D, // F4; F4 |
+ F5 = 0x07003E, // F5; F5 |
+ F6 = 0x07003F, // F6; F6 |
+ F7 = 0x070040, // F7; F7 |
+ F8 = 0x070041, // F8; F8 |
+ F9 = 0x070042, // F9; F9 |
+ F10 = 0x070043, // F10; F10 |
+ F11 = 0x070044, // F11; F11 |
+ F12 = 0x070045, // F12; F12 |
+ F13 = 0x070068, // F13; F13 |
+ F14 = 0x070069, // F14; F14 |
+ F15 = 0x07006A, // F15; F15 |
+ F16 = 0x07006B, // F16; F16 |
+ F17 = 0x07006C, // F17; F17 |
+ F18 = 0x07006D, // F18; F18 |
+ F19 = 0x07006E, // F19; F19 |
+ F20 = 0x07006F, // F20; F20 |
+ F21 = 0x070070, // F21; F21 |
+ F22 = 0x070071, // F22; F22 |
+ F23 = 0x070072, // F23; F23 |
+ F24 = 0x070073, // F24; F24 |
+ FN = 0x000012, // Fn; not a USB code |
+ // FLock is FN_LOCK because F_LOCK conflicts with the lockf(3) macro. |
+ FN_LOCK = 0x000013, // FLock; not a USB code |
+ PRINT_SCREEN = 0x070046, // PrintScreen; PrintScreen |
+ SCROLL_LOCK = 0x070047, // ScrollLock; Scroll Lock |
+ PAUSE = 0x070048, // Pause; Pause |
+ |
+ // 2.1.6 Media Keys |
+ // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-media |
+ BROWSER_BACK = 0x0C0224, // BrowserBack; AC Back |
+ BROWSER_FAVORITES = 0x0C022A, // BrowserFavorites; AC Bookmarks |
+ BROWSER_FORWARD = 0x0C0225, // BrowserForward; AC Forward |
+ BROWSER_HOME = 0x0C0223, // BrowserHome; AC Home |
+ BROWSER_REFRESH = 0x0C0227, // BrowserRefresh; AC Refresh |
+ BROWSER_SEARCH = 0x0C0221, // BrowserSearch; AC Search |
+ BROWSER_STOP = 0x0C0226, // BrowserStop; AC Stop |
+ EJECT = 0x0C00B8, // Eject; Eject |
+ LAUNCH_APP1 = 0x0C0194, // LaunchApp1; AL Local Machine Browser |
+ LAUNCH_APP2 = 0x0C0192, // LaunchApp2; AL Calculator |
+ LAUNCH_MAIL = 0x0C018A, // LaunchMail; AL Email Reader |
+ MEDIA_PLAY_PAUSE = 0x0C00CD, // MediaPlayPause; Play/Pause |
+ MEDIA_SELECT = 0x0C0183, // MediaSelect; AL Consumer Control Configuration |
+ MEDIA_STOP = 0x0C00B7, // MediaStop; Stop |
+ MEDIA_TRACK_NEXT = 0x0C00B5, // MediaTrackNext; Scan Next Track |
+ MEDIA_TRACK_PREVIOUS = 0x0C00B6, // MediaTrackPrevious; Scan Previous Track |
+ POWER = 0x070066, // Power; Keyboard Power |
+ SLEEP = 0x010082, // Sleep; System Sleep |
+ VOLUME_DOWN = 0x070081, // VolumeDown; Volume Down |
+ VOLUME_MUTE = 0x07007F, // VolumeMute; Mute |
+ VOLUME_UP = 0x070080, // VolumeUp; Volume Up |
+ WAKE_UP = 0x010083, // WakeUp; System Wake Up |
+ |
+ // 2.1.7 Legacy Keys and Non-Standard Keys |
+ // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-legacy |
+ HYPER = 0x000010, // Hyper; not a USB code |
+ SUPER = 0x000011, // Super; not a USB code |
+ TURBO = 0x000016, // Turbo; not a USB code |
+ ABORT = 0x07009B, // Abort; Cancel |
+ RESUME = 0x000015, // Resume; not a USB code |
+ SUSPEND = 0x000014, // Suspend; not a USB code |
+ AGAIN = 0x070079, // Again; Again |
+ COPY = 0x07007C, // Copy; Copy |
+ CUT = 0x07007B, // Cut; Cut |
+ FIND = 0x07007E, // Find; Find |
+ OPEN = 0x070074, // Open; Execute |
+ PASTE = 0x07007D, // Paste; Paste |
+ PROPS = 0x0700A3, // Props; CrSel/Props |
+ SELECT = 0x070077, // Select; Select |
+ UNDO = 0x07007A, // Undo; Undo |
+ |
+ // Non-standard codes |
+ BRIGHTNESS_DOWN = 0x0C0070, // BrightnessDown; Display Brightness Decrement |
+ BRIGHTNESS_UP = 0x0C006F, // BrightnessUp; Display Brightness Increment |
+ LAUNCH_SCREEN_SAVER = 0x0C019E, // LaunchScreenSaver; |
+ // AL Terminal Lock/Screensaver |
+ SELECT_TASK = 0x0C01A2, // SelectTask; AL Select Task/Application |
+ ZOOM_TOGGLE = 0x0C0232, // ZoomToggle; AC View Toggle |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_EVENTS_KEYCODES_DOM3_DOM_CODE_H_ |