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.
5 // This file has no header guard because it is explicily intended
6 // to be included more than once with different definitions of the
7 // macros DOM_KEY_MAP and DOM_KEY_MAP_DECLARATION.
9 // This is a table of DOM Level 3 .key values, used to generate identifiers
10 // (enums) and string tables. These names are defined by:
12 // [0] DOM Level 3 KeyboardEvent key Values,
13 // http://www.w3.org/TR/DOM-Level-3-Events-key/
15 // That reference should be consulted on the meaning and usage of these
16 // values; this file does not attempt to describe that.
18 // The names given in the table here directly match the DOM Level 3 value,
19 // and for the most part the corresponding enum identifier is generated from
20 // the name by converting W3C's CamelCaseStyle to Chromium's C_MACRO_STYLE.
22 DOM_KEY_MAP_DECLARATION {
24 // To avoid ambiguities, a small number of .key values that do have
25 // standard names are encoded identical to corresponding Unicode characters;
26 // for example, DomKey('\t') == DomKey::TAB.
28 // Key Enum Unicode code point
29 DOM_KEY_UNI("Backspace", BACKSPACE, 0x0008),
30 DOM_KEY_UNI("Tab", TAB, 0x0009),
31 DOM_KEY_UNI("Enter", ENTER, 0x000D),
32 DOM_KEY_UNI("Escape", ESCAPE, 0x001B),
33 // The enum constant for 'Delete' (Forward Delete) is named DEL because
34 // DELETE conflicts with an unscoped declaration in Windows' <windows.h>.
35 DOM_KEY_UNI("Delete", DEL, 0x007F),
39 // =========================================================
41 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-special
42 // =========================================================
44 // Unable to identify another key value
45 DOM_KEY_MAP("Unidentified", UNIDENTIFIED),
47 // ==========================================================
49 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-modifier
50 // ==========================================================
53 DOM_KEY_MAP("Accel", ACCEL), // Never returned in a key event
54 DOM_KEY_MAP("Alt", ALT),
55 DOM_KEY_MAP("AltGraph", ALT_GRAPH),
56 DOM_KEY_MAP("CapsLock", CAPS_LOCK),
57 DOM_KEY_MAP("Control", CONTROL),
58 DOM_KEY_MAP("Fn", FN),
59 DOM_KEY_MAP("FnLock", FN_LOCK),
60 DOM_KEY_MAP("Hyper", HYPER),
61 DOM_KEY_MAP("Meta", META),
62 DOM_KEY_MAP("NumLock", NUM_LOCK),
63 DOM_KEY_MAP("OS", OS),
64 DOM_KEY_MAP("ScrollLock", SCROLL_LOCK),
65 DOM_KEY_MAP("Shift", SHIFT),
66 DOM_KEY_MAP("Super", SUPER),
67 DOM_KEY_MAP("Symbol", SYMBOL),
68 DOM_KEY_MAP("SymbolLock", SYMBOL_LOCK),
70 // Non-standard value corresponding to XKB keysym ISO_Level5_Shift,
71 // an additional printable-character modifier like Shift and AltGraph,
72 // used by such layouts as Neo (German) and Multix (French-Canadian).
74 DOM_KEY_MAP("ShiftLevel5", SHIFT_LEVEL5),
76 // Non-standard value representing a latching-modifier key in ui::Keyevent.
77 // This is present on some keyboard layouts (Latvian, Tibetan, Cameroon),
78 // and applies the modifier to the next (non-modifier) key.
79 // These events are consumed internally and not exposed to the web,
80 // either directly or as synthetic modifier up/down events.
82 DOM_KEY_MAP(".AltGraphLatch", ALT_GRAPH_LATCH),
84 // ============================================================
86 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-whitespace
87 // ============================================================
90 // "Enter" is encoded in the Unicode space (at the end of this list).
91 DOM_KEY_MAP("Separator", SEPARATOR),
92 // "Tab" is encoded in the Unicode space.
94 // ============================================================
96 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-navigation
97 // ============================================================
100 DOM_KEY_MAP("ArrowDown", ARROW_DOWN),
101 DOM_KEY_MAP("ArrowLeft", ARROW_LEFT),
102 DOM_KEY_MAP("ArrowRight", ARROW_RIGHT),
103 DOM_KEY_MAP("ArrowUp", ARROW_UP),
104 DOM_KEY_MAP("End", END),
105 DOM_KEY_MAP("Home", HOME),
106 DOM_KEY_MAP("PageDown", PAGE_DOWN),
107 DOM_KEY_MAP("PageUp", PAGE_UP),
109 // =========================================================
111 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-editing
112 // =========================================================
115 // "Backspace" is encoded in the Unicode space.
116 DOM_KEY_MAP("Clear", CLEAR),
117 DOM_KEY_MAP("Copy", COPY),
118 DOM_KEY_MAP("CrSel", CR_SEL), // Cursor Select
119 DOM_KEY_MAP("Cut", CUT),
120 // "Delete" is encoded in the Unicode space.
121 DOM_KEY_MAP("EraseEof", ERASE_EOF), // Erase to End of Field
122 DOM_KEY_MAP("ExSel", EX_SEL), // Extend Selection
123 DOM_KEY_MAP("Insert", INSERT),
124 DOM_KEY_MAP("Paste", PASTE),
125 DOM_KEY_MAP("Redo", REDO),
126 DOM_KEY_MAP("Undo", UNDO),
128 // ====================================================
130 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-ui
131 // ====================================================
134 DOM_KEY_MAP("Accept", ACCEPT), // Accept current IME conversion
135 DOM_KEY_MAP("Again", AGAIN), // Repeat an action
136 DOM_KEY_MAP("Attn", ATTN), // Attention
137 DOM_KEY_MAP("Cancel", CANCEL),
138 DOM_KEY_MAP("ContextMenu", CONTEXT_MENU),
139 // "Escape" is encoded in the Unicode space.
140 DOM_KEY_MAP("Execute", EXECUTE),
141 DOM_KEY_MAP("Find", FIND),
142 DOM_KEY_MAP("Help", HELP),
143 DOM_KEY_MAP("Pause", PAUSE), // Program state - not for media
144 DOM_KEY_MAP("Play", PLAY), // Program state - not for media
145 DOM_KEY_MAP("Props", PROPS), // Properties
146 DOM_KEY_MAP("Select", SELECT),
147 DOM_KEY_MAP("ZoomIn", ZOOM_IN),
148 DOM_KEY_MAP("ZoomOut", ZOOM_OUT),
150 // ========================================================
152 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-device
153 // ========================================================
156 DOM_KEY_MAP("BrightnessDown", BRIGHTNESS_DOWN),
157 DOM_KEY_MAP("BrightnessUp", BRIGHTNESS_UP),
158 DOM_KEY_MAP("Camera", CAMERA),
159 DOM_KEY_MAP("Eject", EJECT),
160 DOM_KEY_MAP("LogOff", LOG_OFF),
161 DOM_KEY_MAP("Power", POWER),
162 DOM_KEY_MAP("PowerOff", POWER_OFF),
163 DOM_KEY_MAP("PrintScreen", PRINT_SCREEN),
164 DOM_KEY_MAP("Hibernate", HIBERNATE),
165 DOM_KEY_MAP("Standby", STANDBY),
166 DOM_KEY_MAP("WakeUp", WAKE_UP),
168 // =============================================================
169 // IME and Composition Keys
170 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-composition
171 // =============================================================
174 DOM_KEY_MAP("AllCandidates", ALL_CANDIDATES),
175 DOM_KEY_MAP("Alphanumeric", ALPHANUMERIC),
176 DOM_KEY_MAP("CodeInput", CODE_INPUT),
177 DOM_KEY_MAP("Compose", COMPOSE),
178 DOM_KEY_MAP("Convert", CONVERT),
179 // "Dead" is represented as a flag plus combining character.
180 DOM_KEY_MAP("FinalMode", FINAL_MODE),
181 DOM_KEY_MAP("GroupFirst", GROUP_FIRST),
182 DOM_KEY_MAP("GroupLast", GROUP_LAST),
183 DOM_KEY_MAP("GroupNext", GROUP_NEXT),
184 DOM_KEY_MAP("GroupPrevious", GROUP_PREVIOUS),
185 DOM_KEY_MAP("ModeChange", MODE_CHANGE),
186 DOM_KEY_MAP("NextCandidate", NEXT_CANDIDATE),
187 DOM_KEY_MAP("NonConvert", NON_CONVERT),
188 DOM_KEY_MAP("PreviousCandidate", PREVIOUS_CANDIDATE),
189 DOM_KEY_MAP("Process", PROCESS),
190 DOM_KEY_MAP("SingleCandidate", SINGLE_CANDIDATE),
192 // Keys specific to Korean keyboards
193 DOM_KEY_MAP("HangulMode", HANGUL_MODE),
194 DOM_KEY_MAP("HanjaMode", HANJA_MODE),
195 DOM_KEY_MAP("JunjaMode", JUNJA_MODE),
197 // Keys specific to Japanese keyboards
198 DOM_KEY_MAP("Eisu", EISU),
199 DOM_KEY_MAP("Hankaku", HANKAKU),
200 DOM_KEY_MAP("Hiragana", HIRAGANA),
201 DOM_KEY_MAP("HiraganaKatakana", HIRAGANA_KATAKANA),
202 DOM_KEY_MAP("KanaMode", KANA_MODE),
203 DOM_KEY_MAP("KanjiMode", KANJI_MODE),
204 DOM_KEY_MAP("Katakana", KATAKANA),
205 DOM_KEY_MAP("Romaji", ROMAJI),
206 DOM_KEY_MAP("Zenkaku", ZENKAKU),
207 DOM_KEY_MAP("ZenkakuHankaku", ZENKAKU_HANKAKU),
209 // ==========================================================
210 // General-Purpose Function Keys
211 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-function
212 // ==========================================================
214 // DOM defines open-ended sets, but if we want a finite numeric encoding we
215 // need to draw the line somewhere. USB and Windows (VK) and Linux (evdev)
216 // all support 24, so we define 24.
219 DOM_KEY_MAP("F1", F1),
220 DOM_KEY_MAP("F2", F2),
221 DOM_KEY_MAP("F3", F3),
222 DOM_KEY_MAP("F4", F4),
223 DOM_KEY_MAP("F5", F5),
224 DOM_KEY_MAP("F6", F6),
225 DOM_KEY_MAP("F7", F7),
226 DOM_KEY_MAP("F8", F8),
227 DOM_KEY_MAP("F9", F9),
228 DOM_KEY_MAP("F10", F10),
229 DOM_KEY_MAP("F11", F11),
230 DOM_KEY_MAP("F12", F12),
231 DOM_KEY_MAP("F13", F13),
232 DOM_KEY_MAP("F14", F14),
233 DOM_KEY_MAP("F15", F15),
234 DOM_KEY_MAP("F16", F16),
235 DOM_KEY_MAP("F17", F17),
236 DOM_KEY_MAP("F18", F18),
237 DOM_KEY_MAP("F19", F19),
238 DOM_KEY_MAP("F20", F20),
239 DOM_KEY_MAP("F21", F21),
240 DOM_KEY_MAP("F22", F22),
241 DOM_KEY_MAP("F23", F23),
242 DOM_KEY_MAP("F24", F24),
243 DOM_KEY_MAP("Soft1", SOFT1),
244 DOM_KEY_MAP("Soft2", SOFT2),
245 DOM_KEY_MAP("Soft3", SOFT3),
246 DOM_KEY_MAP("Soft4", SOFT4),
247 DOM_KEY_MAP("Soft5", SOFT5),
248 DOM_KEY_MAP("Soft6", SOFT6),
249 DOM_KEY_MAP("Soft7", SOFT7),
250 DOM_KEY_MAP("Soft8", SOFT8),
252 // ============================================================
254 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-multimedia
255 // ============================================================
258 DOM_KEY_MAP("Close", CLOSE),
259 DOM_KEY_MAP("MailForward", MAIL_FORWARD),
260 DOM_KEY_MAP("MailReply", MAIL_REPLY),
261 DOM_KEY_MAP("MailSend", MAIL_SEND),
262 DOM_KEY_MAP("MediaPlayPause", MEDIA_PLAY_PAUSE),
263 DOM_KEY_MAP("MediaSelect", MEDIA_SELECT),
264 DOM_KEY_MAP("MediaStop", MEDIA_STOP),
265 DOM_KEY_MAP("MediaTrackNext", MEDIA_TRACK_NEXT),
266 DOM_KEY_MAP("MediaTrackPrevious", MEDIA_TRACK_PREVIOUS),
267 DOM_KEY_MAP("New", NEW),
268 DOM_KEY_MAP("Open", OPEN),
269 DOM_KEY_MAP("Print", PRINT),
270 DOM_KEY_MAP("Save", SAVE),
271 DOM_KEY_MAP("SpellCheck", SPELL_CHECK),
272 DOM_KEY_MAP("VolumeDown", VOLUME_DOWN),
273 DOM_KEY_MAP("VolumeUp", VOLUME_UP),
274 DOM_KEY_MAP("VolumeMute", VOLUME_MUTE),
276 // ======================================================
278 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-apps
279 // ======================================================
282 DOM_KEY_MAP("LaunchCalculator", LAUNCH_CALCULATOR), // Application 2
283 DOM_KEY_MAP("LaunchCalendar", LAUNCH_CALENDAR),
284 DOM_KEY_MAP("LaunchMail", LAUNCH_MAIL),
285 DOM_KEY_MAP("LaunchMediaPlayer", LAUNCH_MEDIA_PLAYER),
286 DOM_KEY_MAP("LaunchMusicPlayer", LAUNCH_MUSIC_PLAYER),
287 DOM_KEY_MAP("LaunchMyComputer", LAUNCH_MY_COMPUTER), // Application 1
288 DOM_KEY_MAP("LaunchScreenSaver", LAUNCH_SCREEN_SAVER),
289 DOM_KEY_MAP("LaunchSpreadsheet", LAUNCH_SPREADSHEET),
290 DOM_KEY_MAP("LaunchWebBrowser", LAUNCH_WEB_BROWSER),
291 DOM_KEY_MAP("LaunchWebCam", LAUNCH_WEB_CAM),
292 DOM_KEY_MAP("LaunchWordProcessor", LAUNCH_WORD_PROCESSOR),
294 // =========================================================
296 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-browser
297 // =========================================================
300 DOM_KEY_MAP("BrowserBack", BROWSER_BACK),
301 DOM_KEY_MAP("BrowserFavorites", BROWSER_FAVORITES),
302 DOM_KEY_MAP("BrowserForward", BROWSER_FORWARD),
303 DOM_KEY_MAP("BrowserHome", BROWSER_HOME),
304 DOM_KEY_MAP("BrowserRefresh", BROWSER_REFRESH),
305 DOM_KEY_MAP("BrowserSearch", BROWSER_SEARCH),
306 DOM_KEY_MAP("BrowserStop", BROWSER_STOP),
308 // ==================================================================
309 // Media Controller Keys
310 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-media-controller
311 // ==================================================================
314 DOM_KEY_MAP("AudioBalanceLeft", AUDIO_BALANCE_LEFT),
315 DOM_KEY_MAP("AudioBalanceRight", AUDIO_BALANCE_RIGHT),
316 DOM_KEY_MAP("AudioBassBoostDown", AUDIO_BASS_BOOST_DOWN),
317 DOM_KEY_MAP("AudioBassBoostUp", AUDIO_BASS_BOOST_UP),
318 DOM_KEY_MAP("AudioFaderFront", AUDIO_FADER_FRONT),
319 DOM_KEY_MAP("AudioFaderRear", AUDIO_FADER_REAR),
320 DOM_KEY_MAP("AudioSurroundModeNext",AUDIO_SURROUND_MODE_NEXT),
321 DOM_KEY_MAP("AVRInput", AVR_INPUT),
322 DOM_KEY_MAP("AVRPower", AVR_POWER),
323 DOM_KEY_MAP("ChannelDown", CHANNEL_DOWN),
324 DOM_KEY_MAP("ChannelUp", CHANNEL_UP),
325 DOM_KEY_MAP("ColorF0Red", COLOR_F0_RED),
326 DOM_KEY_MAP("ColorF1Green", COLOR_F1_GREEN),
327 DOM_KEY_MAP("ColorF2Yellow", COLOR_F2_YELLOW),
328 DOM_KEY_MAP("ColorF3Blue", COLOR_F3_BLUE),
329 DOM_KEY_MAP("ColorF4Grey", COLOR_F4_GREY),
330 DOM_KEY_MAP("ColorF5Brown", COLOR_F5_BROWN),
331 DOM_KEY_MAP("ClosedCaptionToggle", CLOSED_CAPTION_TOGGLE),
332 DOM_KEY_MAP("Dimmer", DIMMER),
333 DOM_KEY_MAP("DisplaySwap", DISPLAY_SWAP),
334 DOM_KEY_MAP("Exit", EXIT),
335 DOM_KEY_MAP("FavoriteClear0", FAVORITE_CLEAR0),
336 DOM_KEY_MAP("FavoriteClear1", FAVORITE_CLEAR1),
337 DOM_KEY_MAP("FavoriteClear2", FAVORITE_CLEAR2),
338 DOM_KEY_MAP("FavoriteClear3", FAVORITE_CLEAR3),
339 DOM_KEY_MAP("FavoriteRecall0", FAVORITE_RECALL0),
340 DOM_KEY_MAP("FavoriteRecall1", FAVORITE_RECALL1),
341 DOM_KEY_MAP("FavoriteRecall2", FAVORITE_RECALL2),
342 DOM_KEY_MAP("FavoriteRecall3", FAVORITE_RECALL3),
343 DOM_KEY_MAP("FavoriteStore0", FAVORITE_STORE0),
344 DOM_KEY_MAP("FavoriteStore1", FAVORITE_STORE1),
345 DOM_KEY_MAP("FavoriteStore2", FAVORITE_STORE2),
346 DOM_KEY_MAP("FavoriteStore3", FAVORITE_STORE3),
347 DOM_KEY_MAP("Guide", GUIDE),
348 DOM_KEY_MAP("GuideNextDay", GUIDE_NEXT_DAY),
349 DOM_KEY_MAP("GuidePreviousDay", GUIDE_PREVIOUS_DAY),
350 DOM_KEY_MAP("Info", INFO),
351 DOM_KEY_MAP("InstantReplay", INSTANT_REPLAY),
352 DOM_KEY_MAP("Link", LINK),
353 DOM_KEY_MAP("ListProgram", LIST_PROGRAM),
354 DOM_KEY_MAP("LiveContent", LIVE_CONTENT),
355 DOM_KEY_MAP("Lock", LOCK),
356 DOM_KEY_MAP("MediaApps", MEDIA_APPS),
357 DOM_KEY_MAP("MediaFastForward", MEDIA_FAST_FORWARD),
358 DOM_KEY_MAP("MediaLast", MEDIA_LAST),
359 DOM_KEY_MAP("MediaPause", MEDIA_PAUSE),
360 DOM_KEY_MAP("MediaPlay", MEDIA_PLAY),
361 DOM_KEY_MAP("MediaRecord", MEDIA_RECORD),
362 DOM_KEY_MAP("MediaRewind", MEDIA_REWIND),
363 DOM_KEY_MAP("MediaSkip", MEDIA_SKIP),
364 DOM_KEY_MAP("NextFavoriteChannel", NEXT_FAVORITE_CHANNEL),
365 DOM_KEY_MAP("NextUserProfile", NEXT_USER_PROFILE),
366 DOM_KEY_MAP("OnDemand", ON_DEMAND),
367 DOM_KEY_MAP("PinPDown", PINP_DOWN),
368 DOM_KEY_MAP("PinPMove", PINP_MOVE),
369 DOM_KEY_MAP("PinPToggle", PINP_TOGGLE),
370 DOM_KEY_MAP("PinPUp", PINP_UP),
371 DOM_KEY_MAP("PlaySpeedDown", PLAY_SPEED_DOWN),
372 DOM_KEY_MAP("PlaySpeedReset", PLAY_SPEED_RESET),
373 DOM_KEY_MAP("PlaySpeedUp", PLAY_SPEED_UP),
374 DOM_KEY_MAP("RandomToggle", RANDOM_TOGGLE),
375 DOM_KEY_MAP("RcLowBattery", RC_LOW_BATTERY),
376 DOM_KEY_MAP("RecordSpeedNext", RECORD_SPEED_NEXT),
377 DOM_KEY_MAP("RfBypass", RF_BYPASS),
378 DOM_KEY_MAP("ScanChannelsToggle", SCAN_CHANNELS_TOGGLE),
379 DOM_KEY_MAP("ScreenModeNext", SCREEN_MODE_NEXT),
380 DOM_KEY_MAP("Settings", SETTINGS),
381 DOM_KEY_MAP("SplitScreenToggle", SPLIT_SCREEN_TOGGLE),
382 DOM_KEY_MAP("STBInput", STB_INPUT),
383 DOM_KEY_MAP("STBPower", STB_POWER),
384 DOM_KEY_MAP("Subtitle", SUBTITLE),
385 DOM_KEY_MAP("Teletext", TELETEXT),
386 DOM_KEY_MAP("TV", T_V),
387 DOM_KEY_MAP("TVInput", TV_INPUT),
388 DOM_KEY_MAP("TVPower", TV_POWER),
389 DOM_KEY_MAP("VideoModeNext", VIDEO_MODE_NEXT),
390 DOM_KEY_MAP("Wink", WINK),
391 DOM_KEY_MAP("ZoomToggle", ZOOM_TOGGLE),