Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: ui/events/keycodes/dom3/dom_code.h

Issue 641753003: DOM Level 3 .code and .key value enumerations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove generator script Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_EVENTS_KEYCODES_DOM3_DOM_CODE_H_
6 #define UI_EVENTS_KEYCODES_DOM3_DOM_CODE_H_
7
8 // DOM Level 3 .code value enumeration constants, as defined by:
9 //
10 // [0] DOM Level 3 KeyboardEvent code Values,
11 // http://www.w3.org/TR/DOM-Level-3-Events-code/
12 //
13 // That reference should be consulted on the meaning and usage of these
14 // values; this file does not attempt to describe that.
15 //
16 // Additional references:
17 //
18 // [1] Document Object Model (DOM) Level 3 Events Specification,
19 // http://www.w3.org/TR/DOM-Level-3-Events/
20 // [2] DOM Level 3 KeyboardEvent key Values,
21 // http://www.w3.org/TR/DOM-Level-3-Events-key/
22 // [3] Legacy Keyboard Event Properties,
23 // https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/Note-KeyProps.html
24 // [4] USB HID Usage Tables,
25 // http://www.usb.org/developers/devclass_docs/Hut1_11.pdf
26 // [5] Linux <linux/evdev.h>
27 // [6] Windows <ime.h> and <winuser.h>
28 // [7] OS X <HIToolbox/Events.h>
29 //
30 // DOM3 values are defined as text, but numeric values (enum constants) are
31 // useful internally, e.g. for IPC or rapid dispatch. The numeric values
32 // are chosen to correspond to the USB codes ((PageID << 16) | UsageID)
33 // and the comments below indicate the USB name as well as the DOM3 name.
34 // Non-USB codes use page 0.
35 //
36 // The enum identifiers are systematically derived from the DOM names by
37 // inserting an underscore between consecutive 'words' and converting to
38 // upper case.
39 //
40 // This file is organized following the sections of the W3C document [0].
41 //
42 // When adding a value, be sure to add the DOM name to the string table
43 // in keycode_converter.cc as well, and the USB and platform scan codes
44 // to keycode_converter_data.h.
45
46 namespace ui {
47
48 enum class DomCode {
49 // Zero is reserved to mean no value; there is no corresponding DOM string.
50 NONE = 0x0000,
51
52 // Writing System Keys
53 // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-alphanumeric-writing-syst em
54 BACKQUOTE = 0x070035, // Backquote; ` and ~
55 BACKSLASH = 0x070031, // Backslash; \\ and |
56 BACKSPACE = 0x07002A, // Backspace; Backspace
57 BRACKET_LEFT = 0x07002F, // BracketLeft; [ and {
58 BRACKET_RIGHT = 0x070030, // BracketRight; ] and }
59 COMMA = 0x070036, // Comma; , and <
60 DIGIT0 = 0x070027, // Digit0; 0 and )
61 DIGIT1 = 0x07001E, // Digit1; 1 and !
62 DIGIT2 = 0x07001F, // Digit2; 2 and @
63 DIGIT3 = 0x070020, // Digit3; 3 and #
64 DIGIT4 = 0x070021, // Digit4; 4 and $
65 DIGIT5 = 0x070022, // Digit5; 5 and %
66 DIGIT6 = 0x070023, // Digit6; 6 and ^
67 DIGIT7 = 0x070024, // Digit7; 7 and &
68 DIGIT8 = 0x070025, // Digit8; 8 and *
69 DIGIT9 = 0x070026, // Digit9; 9 and (
70 EQUAL = 0x07002E, // Equal; = and +
71 INTL_BACKSLASH = 0x070064, // IntlBackslash; Non-US \\ and |
72 INTL_HASH = 0x070032, // IntlHash; # and ~
73 INTL_RO = 0x070087, // IntlRo; Non-US / and ?
74 INTL_YEN = 0x070089, // IntlYen; International3
75 KEY_A = 0x070004, // KeyA; a and A
76 KEY_B = 0x070005, // KeyB; b and B
77 KEY_C = 0x070006, // KeyC; c and C
78 KEY_D = 0x070007, // KeyD; d and D
79 KEY_E = 0x070008, // KeyE; e and E
80 KEY_F = 0x070009, // KeyF; f and F
81 KEY_G = 0x07000A, // KeyG; g and G
82 KEY_H = 0x07000B, // KeyH; h and H
83 KEY_I = 0x07000C, // KeyI; i and I
84 KEY_J = 0x07000D, // KeyJ; j and J
85 KEY_K = 0x07000E, // KeyK; k and K
86 KEY_L = 0x07000F, // KeyL; l and L
87 KEY_M = 0x070010, // KeyM; m and M
88 KEY_N = 0x070011, // KeyN; n and N
89 KEY_O = 0x070012, // KeyO; o and O
90 KEY_P = 0x070013, // KeyP; p and P
91 KEY_Q = 0x070014, // KeyQ; q and Q
92 KEY_R = 0x070015, // KeyR; r and R
93 KEY_S = 0x070016, // KeyS; s and S
94 KEY_T = 0x070017, // KeyT; t and T
95 KEY_U = 0x070018, // KeyU; u and U
96 KEY_V = 0x070019, // KeyV; v and V
97 KEY_W = 0x07001A, // KeyW; w and W
98 KEY_X = 0x07001B, // KeyX; x and X
99 KEY_Y = 0x07001C, // KeyY; y and Y
100 KEY_Z = 0x07001D, // KeyZ; z and Z
101 MINUS = 0x07002D, // Minus; - and _
102 PERIOD = 0x070037, // Period; . and >
103 QUOTE = 0x070034, // Quote; $A and $B
104 SEMICOLON = 0x070033, // Semicolon; ; and :
105 SLASH = 0x070038, // Slash; / and ?
106
107 // 2.1.1.2 Functional Keys
108 // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-alphanumeric-functional
109 ALT_LEFT = 0x0700E2, // AltLeft; Left Alt (Meta)
110 ALT_RIGHT = 0x0700E6, // AltRight; Right Alt (Meta)
111 CAPS_LOCK = 0x070039, // CapsLock; Caps Lock
112 CONTEXT_MENU = 0x070065, // ContextMenu; Application (Compose)
113 CONTROL_LEFT = 0x0700E0, // ControlLeft; Left Control
114 CONTROL_RIGHT = 0x0700E4, // ControlRight; Right Control
115 ENTER = 0x070028, // Enter; Return (ENTER)
116 OS_LEFT = 0x0700E3, // OSLeft; Left GUI (Command, Win)
117 OS_RIGHT = 0x0700E7, // OSRight; Right GUI (Command, Win)
118 SHIFT_LEFT = 0x0700E1, // ShiftLeft; Left Shift
119 SHIFT_RIGHT = 0x0700E5, // ShiftRight; Right Shift
120 SPACE = 0x07002C, // Space; Spacebar
121 TAB = 0x07002B, // Tab; Tab
122
123 CONVERT = 0x07008A, // Convert; International4
124 KANA_MODE = 0x070088, // KanaMode; International2
125 LANG1 = 0x070090, // Lang1; LANG1 (Hangul/English)
126 LANG2 = 0x070091, // Lang2; LANG2 (Hanja)
127 LANG3 = 0x070092, // Lang3; LANG3 (Katakana)
128 LANG4 = 0x070093, // Lang4; LANG4 (Hiragana)
129 LANG5 = 0x070094, // Lang5; LANG5 (Zenkaku/Henkaku)
130 NON_CONVERT = 0x07008B, // NonConvert; International5
131
132 // 2.1.2 Control Pad Section
133 // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-controlpad-section
134 DELETE = 0x07004C, // Delete; Delete Forward (DEL)
135 END = 0x07004D, // End; End
136 HELP = 0x070075, // Help; Help
137 HOME = 0x07004A, // Home; Home
138 INSERT = 0x070049, // Insert; Insert
139 PAGE_DOWN = 0x07004E, // PageDown; PageDown
140 PAGE_UP = 0x07004B, // PageUp; PageUp
141
142 // 2.1.3 Arrow Pad Section
143 // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-arrowpad-section
144 ARROW_DOWN = 0x070051, // ArrowDown; DownArrow
145 ARROW_LEFT = 0x070050, // ArrowLeft; LeftArrow
146 ARROW_RIGHT = 0x07004F, // ArrowRight; RightArrow
147 ARROW_UP = 0x070052, // ArrowUp; UpArrow
148
149 // 2.1.4 Numpad Section
150 // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-numpad-section
151 NUM_LOCK = 0x070053, // NumLock; Keypad Num Lock and Clear
152 NUMPAD0 = 0x070062, // Numpad0; Keypad 0 and Insert
153 NUMPAD1 = 0x070059, // Numpad1; Keypad 1 and End
154 NUMPAD2 = 0x07005A, // Numpad2; Keypad 2 and Down Arrow
155 NUMPAD3 = 0x07005B, // Numpad3; Keypad 3 and PageDn
156 NUMPAD4 = 0x07005C, // Numpad4; Keypad 4 and Left Arrow
157 NUMPAD5 = 0x07005D, // Numpad5; Keypad 5
158 NUMPAD6 = 0x07005E, // Numpad6; Keypad 6 and Right Arrow
159 NUMPAD7 = 0x07005F, // Numpad7; Keypad 7 and Home
160 NUMPAD8 = 0x070060, // Numpad8; Keypad 8 and Up Arrow
161 NUMPAD9 = 0x070061, // Numpad9; Keypad 9 and PageUp
162 NUMPAD_ADD = 0x070057, // NumpadAdd; Keypad +
163 NUMPAD_BACKSPACE = 0x0700BB, // NumpadBackspace; Keypad Backspace
164 NUMPAD_CLEAR = 0x0700D8, // NumpadClear; Keypad Clear
165 NUMPAD_CLEAR_ENTRY = 0x0700D9, // NumpadClearEntry; Keypad Clear Entry
166 NUMPAD_COMMA = 0x070085, // NumpadComma; Keypad Comma
167 NUMPAD_DECIMAL = 0x070063, // NumpadDecimal; Keypad . and Delete
168 NUMPAD_DIVIDE = 0x070054, // NumpadDivide; Keypad /
169 NUMPAD_ENTER = 0x070058, // NumpadEnter; Keypad ENTER
170 NUMPAD_EQUAL = 0x070067, // NumpadEqual; Keypad =
171 NUMPAD_MEMORY_ADD = 0x0700D3, // NumpadMemoryAdd; Keypad Memory Add
172 NUMPAD_MEMORY_CLEAR = 0x0700D2, // NumpadMemoryClear; Keypad Memory Clear
173 NUMPAD_MEMORY_RECALL = 0x0700D1, // NumpadMemoryRecall; Keypad Memory Recall
174 NUMPAD_MEMORY_STORE = 0x0700D0, // NumpadMemoryStore; Keypad Memory Store
175 NUMPAD_MEMORY_SUBTRACT = 0x0700D4, // NumpadMemorySubtract;
176 // Keypad Memory Subtract
177 NUMPAD_MULTIPLY = 0x070055, // NumpadMultiply; Keypad *
178 NUMPAD_PAREN_LEFT = 0x0700B6, // NumpadParenLeft; Keypad (
179 NUMPAD_PAREN_RIGHT = 0x0700B7, // NumpadParenRight; Keypad )
180 NUMPAD_SUBTRACT = 0x070056, // NumpadSubtract; Keypad -
181
182 // 2.1.5 Function Section
183 // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-function-section
184 ESCAPE = 0x070029, // Escape; Escape
185 F1 = 0x07003A, // F1; F1
186 F2 = 0x07003B, // F2; F2
187 F3 = 0x07003C, // F3; F3
188 F4 = 0x07003D, // F4; F4
189 F5 = 0x07003E, // F5; F5
190 F6 = 0x07003F, // F6; F6
191 F7 = 0x070040, // F7; F7
192 F8 = 0x070041, // F8; F8
193 F9 = 0x070042, // F9; F9
194 F10 = 0x070043, // F10; F10
195 F11 = 0x070044, // F11; F11
196 F12 = 0x070045, // F12; F12
197 F13 = 0x070068, // F13; F13
198 F14 = 0x070069, // F14; F14
199 F15 = 0x07006A, // F15; F15
200 F16 = 0x07006B, // F16; F16
201 F17 = 0x07006C, // F17; F17
202 F18 = 0x07006D, // F18; F18
203 F19 = 0x07006E, // F19; F19
204 F20 = 0x07006F, // F20; F20
205 F21 = 0x070070, // F21; F21
206 F22 = 0x070071, // F22; F22
207 F23 = 0x070072, // F23; F23
208 F24 = 0x070073, // F24; F24
209 FN = 0x000012, // Fn; not a USB code
210 // FLock is FN_LOCK because F_LOCK conflicts with the lockf(3) macro.
211 FN_LOCK = 0x000013, // FLock; not a USB code
212 PRINT_SCREEN = 0x070046, // PrintScreen; PrintScreen
213 SCROLL_LOCK = 0x070047, // ScrollLock; Scroll Lock
214 PAUSE = 0x070048, // Pause; Pause
215
216 // 2.1.6 Media Keys
217 // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-media
218 BROWSER_BACK = 0x0C0224, // BrowserBack; AC Back
219 BROWSER_FAVORITES = 0x0C022A, // BrowserFavorites; AC Bookmarks
220 BROWSER_FORWARD = 0x0C0225, // BrowserForward; AC Forward
221 BROWSER_HOME = 0x0C0223, // BrowserHome; AC Home
222 BROWSER_REFRESH = 0x0C0227, // BrowserRefresh; AC Refresh
223 BROWSER_SEARCH = 0x0C0221, // BrowserSearch; AC Search
224 BROWSER_STOP = 0x0C0226, // BrowserStop; AC Stop
225 EJECT = 0x0C00B8, // Eject; Eject
226 LAUNCH_APP1 = 0x0C0194, // LaunchApp1; AL Local Machine Browser
227 LAUNCH_APP2 = 0x0C0192, // LaunchApp2; AL Calculator
228 LAUNCH_MAIL = 0x0C018A, // LaunchMail; AL Email Reader
229 MEDIA_PLAY_PAUSE = 0x0C00CD, // MediaPlayPause; Play/Pause
230 MEDIA_SELECT = 0x0C0183, // MediaSelect; AL Consumer Control Configuration
231 MEDIA_STOP = 0x0C00B7, // MediaStop; Stop
232 MEDIA_TRACK_NEXT = 0x0C00B5, // MediaTrackNext; Scan Next Track
233 MEDIA_TRACK_PREVIOUS = 0x0C00B6, // MediaTrackPrevious; Scan Previous Track
234 POWER = 0x070066, // Power; Keyboard Power
235 SLEEP = 0x010082, // Sleep; System Sleep
236 VOLUME_DOWN = 0x070081, // VolumeDown; Volume Down
237 VOLUME_MUTE = 0x07007F, // VolumeMute; Mute
238 VOLUME_UP = 0x070080, // VolumeUp; Volume Up
239 WAKE_UP = 0x010083, // WakeUp; System Wake Up
240
241 // 2.1.7 Legacy Keys and Non-Standard Keys
242 // http://www.w3.org/TR/DOM-Level-3-Events-code/#key-legacy
243 HYPER = 0x000010, // Hyper; not a USB code
244 SUPER = 0x000011, // Super; not a USB code
245 TURBO = 0x000016, // Turbo; not a USB code
246 ABORT = 0x07009B, // Abort; Cancel
247 RESUME = 0x000015, // Resume; not a USB code
248 SUSPEND = 0x000014, // Suspend; not a USB code
249 AGAIN = 0x070079, // Again; Again
250 COPY = 0x07007C, // Copy; Copy
251 CUT = 0x07007B, // Cut; Cut
252 FIND = 0x07007E, // Find; Find
253 OPEN = 0x070074, // Open; Execute
254 PASTE = 0x07007D, // Paste; Paste
255 PROPS = 0x0700A3, // Props; CrSel/Props
256 SELECT = 0x070077, // Select; Select
257 UNDO = 0x07007A, // Undo; Undo
258
259 // Non-standard codes
260 BRIGHTNESS_DOWN = 0x0C0070, // BrightnessDown; Display Brightness Decrement
261 BRIGHTNESS_UP = 0x0C006F, // BrightnessUp; Display Brightness Increment
262 LAUNCH_SCREEN_SAVER = 0x0C019E, // LaunchScreenSaver;
263 // AL Terminal Lock/Screensaver
264 SELECT_TASK = 0x0C01A2, // SelectTask; AL Select Task/Application
265 ZOOM_TOGGLE = 0x0C0232, // ZoomToggle; AC View Toggle
266 };
267
268 } // namespace ui
269
270 #endif // UI_EVENTS_KEYCODES_DOM3_DOM_CODE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698