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 // The first entry, whose enum value will be zero, is reserved to mean
25 // no value; there is no corresponding DOM string. (This is not the same
26 // as the valid DOM .key value 'Unidentified'.)
29 DOM_KEY_MAP(nullptr, NONE), // No value
31 // A value of DomKey::CHARACTER indicates that the KeyboardEvent |key|
32 // string is determined by the Unicode character interpretation and is
33 // not one of the fixed string values.
34 DOM_KEY_MAP(nullptr, CHARACTER),
36 // =========================================================
38 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-special
39 // =========================================================
41 // Unable to identify another key value
42 DOM_KEY_MAP("Unidentified", UNIDENTIFIED),
44 // ==========================================================
46 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-modifier
47 // ==========================================================
50 DOM_KEY_MAP("Accel", ACCEL), // Never returned in a key event
51 DOM_KEY_MAP("Alt", ALT),
52 DOM_KEY_MAP("AltGraph", ALT_GRAPH),
53 DOM_KEY_MAP("CapsLock", CAPS_LOCK),
54 DOM_KEY_MAP("Control", CONTROL),
55 DOM_KEY_MAP("Fn", FN),
56 DOM_KEY_MAP("FnLock", FN_LOCK),
57 DOM_KEY_MAP("Hyper", HYPER),
58 DOM_KEY_MAP("Meta", META),
59 DOM_KEY_MAP("NumLock", NUM_LOCK),
60 DOM_KEY_MAP("OS", OS),
61 DOM_KEY_MAP("ScrollLock", SCROLL_LOCK),
62 DOM_KEY_MAP("Shift", SHIFT),
63 DOM_KEY_MAP("Super", SUPER),
64 DOM_KEY_MAP("Symbol", SYMBOL),
65 DOM_KEY_MAP("SymbolLock", SYMBOL_LOCK),
67 // Non-standard value corresponding to XKB keysym ISO_Level5_Shift,
68 // an additional printable-character modifier like Shift and AltGraph,
69 // used by such layouts as Neo (German) and Multix (French-Canadian).
71 DOM_KEY_MAP("ShiftLevel5", SHIFT_LEVEL5),
73 // ============================================================
75 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-whitespace
76 // ============================================================
79 DOM_KEY_MAP("Enter", ENTER), // Enter, Return
80 DOM_KEY_MAP("Separator", SEPARATOR),
81 DOM_KEY_MAP("Tab", TAB),
83 // ============================================================
85 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-navigation
86 // ============================================================
89 DOM_KEY_MAP("ArrowDown", ARROW_DOWN),
90 DOM_KEY_MAP("ArrowLeft", ARROW_LEFT),
91 DOM_KEY_MAP("ArrowRight", ARROW_RIGHT),
92 DOM_KEY_MAP("ArrowUp", ARROW_UP),
93 DOM_KEY_MAP("End", END),
94 DOM_KEY_MAP("Home", HOME),
95 DOM_KEY_MAP("PageDown", PAGE_DOWN),
96 DOM_KEY_MAP("PageUp", PAGE_UP),
98 // =========================================================
100 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-editing
101 // =========================================================
104 DOM_KEY_MAP("Backspace", BACKSPACE),
105 DOM_KEY_MAP("Clear", CLEAR),
106 DOM_KEY_MAP("Copy", COPY),
107 DOM_KEY_MAP("CrSel", CR_SEL), // Cursor Select
108 DOM_KEY_MAP("Cut", CUT),
109 // Delete (Forward Delete) named DEL because DELETE conflicts with <windows.h>
110 DOM_KEY_MAP("Delete", DEL),
111 DOM_KEY_MAP("EraseEof", ERASE_EOF), // Erase to End of Field
112 DOM_KEY_MAP("ExSel", EX_SEL), // Extend Selection
113 DOM_KEY_MAP("Insert", INSERT),
114 DOM_KEY_MAP("Paste", PASTE),
115 DOM_KEY_MAP("Redo", REDO),
116 DOM_KEY_MAP("Undo", UNDO),
118 // ====================================================
120 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-ui
121 // ====================================================
124 DOM_KEY_MAP("Accept", ACCEPT), // Accept current IME conversion
125 DOM_KEY_MAP("Again", AGAIN), // Repeat an action
126 DOM_KEY_MAP("Attn", ATTN), // Attention
127 DOM_KEY_MAP("Cancel", CANCEL),
128 DOM_KEY_MAP("ContextMenu", CONTEXT_MENU),
129 DOM_KEY_MAP("Escape", ESCAPE),
130 DOM_KEY_MAP("Execute", EXECUTE),
131 DOM_KEY_MAP("Find", FIND),
132 DOM_KEY_MAP("Help", HELP),
133 DOM_KEY_MAP("Pause", PAUSE), // Program state - not for media
134 DOM_KEY_MAP("Play", PLAY), // Program state - not for media
135 DOM_KEY_MAP("Props", PROPS), // Properties
136 DOM_KEY_MAP("Select", SELECT),
137 DOM_KEY_MAP("ZoomIn", ZOOM_IN),
138 DOM_KEY_MAP("ZoomOut", ZOOM_OUT),
140 // ========================================================
142 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-device
143 // ========================================================
146 DOM_KEY_MAP("BrightnessDown", BRIGHTNESS_DOWN),
147 DOM_KEY_MAP("BrightnessUp", BRIGHTNESS_UP),
148 DOM_KEY_MAP("Camera", CAMERA),
149 DOM_KEY_MAP("Eject", EJECT),
150 DOM_KEY_MAP("LogOff", LOG_OFF),
151 DOM_KEY_MAP("Power", POWER),
152 DOM_KEY_MAP("PowerOff", POWER_OFF),
153 DOM_KEY_MAP("PrintScreen", PRINT_SCREEN),
154 DOM_KEY_MAP("Hibernate", HIBERNATE),
155 DOM_KEY_MAP("Standby", STANDBY),
156 DOM_KEY_MAP("WakeUp", WAKE_UP),
158 // =============================================================
159 // IME and Composition Keys
160 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-composition
161 // =============================================================
164 DOM_KEY_MAP("AllCandidates", ALL_CANDIDATES),
165 DOM_KEY_MAP("Alphanumeric", ALPHANUMERIC),
166 DOM_KEY_MAP("CodeInput", CODE_INPUT),
167 DOM_KEY_MAP("Compose", COMPOSE),
168 DOM_KEY_MAP("Convert", CONVERT),
169 DOM_KEY_MAP("Dead", DEAD),
170 DOM_KEY_MAP("FinalMode", FINAL_MODE),
171 DOM_KEY_MAP("GroupFirst", GROUP_FIRST),
172 DOM_KEY_MAP("GroupLast", GROUP_LAST),
173 DOM_KEY_MAP("GroupNext", GROUP_NEXT),
174 DOM_KEY_MAP("GroupPrevious", GROUP_PREVIOUS),
175 DOM_KEY_MAP("ModeChange", MODE_CHANGE),
176 DOM_KEY_MAP("NextCandidate", NEXT_CANDIDATE),
177 DOM_KEY_MAP("NonConvert", NON_CONVERT),
178 DOM_KEY_MAP("PreviousCandidate", PREVIOUS_CANDIDATE),
179 DOM_KEY_MAP("Process", PROCESS),
180 DOM_KEY_MAP("SingleCandidate", SINGLE_CANDIDATE),
182 // Keys specific to Korean keyboards
183 DOM_KEY_MAP("HangulMode", HANGUL_MODE),
184 DOM_KEY_MAP("HanjaMode", HANJA_MODE),
185 DOM_KEY_MAP("JunjaMode", JUNJA_MODE),
187 // Keys specific to Japanese keyboards
188 DOM_KEY_MAP("Eisu", EISU),
189 DOM_KEY_MAP("Hankaku", HANKAKU),
190 DOM_KEY_MAP("Hiragana", HIRAGANA),
191 DOM_KEY_MAP("HiraganaKatakana", HIRAGANA_KATAKANA),
192 DOM_KEY_MAP("KanaMode", KANA_MODE),
193 DOM_KEY_MAP("KanjiMode", KANJI_MODE),
194 DOM_KEY_MAP("Katakana", KATAKANA),
195 DOM_KEY_MAP("Romaji", ROMAJI),
196 DOM_KEY_MAP("Zenkaku", ZENKAKU),
197 DOM_KEY_MAP("ZenkakuHankaku", ZENKAKU_HANKAKU),
199 // ==========================================================
200 // General-Purpose Function Keys
201 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-function
202 // ==========================================================
204 // DOM defines open-ended sets, but if we want a finite numeric encoding we
205 // need to draw the line somewhere. USB and Windows (VK) and Linux (evdev)
206 // all support 24, so we define 24.
209 DOM_KEY_MAP("F1", F1),
210 DOM_KEY_MAP("F2", F2),
211 DOM_KEY_MAP("F3", F3),
212 DOM_KEY_MAP("F4", F4),
213 DOM_KEY_MAP("F5", F5),
214 DOM_KEY_MAP("F6", F6),
215 DOM_KEY_MAP("F7", F7),
216 DOM_KEY_MAP("F8", F8),
217 DOM_KEY_MAP("F9", F9),
218 DOM_KEY_MAP("F10", F10),
219 DOM_KEY_MAP("F11", F11),
220 DOM_KEY_MAP("F12", F12),
221 DOM_KEY_MAP("F13", F13),
222 DOM_KEY_MAP("F14", F14),
223 DOM_KEY_MAP("F15", F15),
224 DOM_KEY_MAP("F16", F16),
225 DOM_KEY_MAP("F17", F17),
226 DOM_KEY_MAP("F18", F18),
227 DOM_KEY_MAP("F19", F19),
228 DOM_KEY_MAP("F20", F20),
229 DOM_KEY_MAP("F21", F21),
230 DOM_KEY_MAP("F22", F22),
231 DOM_KEY_MAP("F23", F23),
232 DOM_KEY_MAP("F24", F24),
233 DOM_KEY_MAP("Soft1", SOFT1),
234 DOM_KEY_MAP("Soft2", SOFT2),
235 DOM_KEY_MAP("Soft3", SOFT3),
236 DOM_KEY_MAP("Soft4", SOFT4),
237 DOM_KEY_MAP("Soft5", SOFT5),
238 DOM_KEY_MAP("Soft6", SOFT6),
239 DOM_KEY_MAP("Soft7", SOFT7),
240 DOM_KEY_MAP("Soft8", SOFT8),
242 // ============================================================
244 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-multimedia
245 // ============================================================
248 DOM_KEY_MAP("Close", CLOSE),
249 DOM_KEY_MAP("MailForward", MAIL_FORWARD),
250 DOM_KEY_MAP("MailReply", MAIL_REPLY),
251 DOM_KEY_MAP("MailSend", MAIL_SEND),
252 DOM_KEY_MAP("MediaPlayPause", MEDIA_PLAY_PAUSE),
253 DOM_KEY_MAP("MediaSelect", MEDIA_SELECT),
254 DOM_KEY_MAP("MediaStop", MEDIA_STOP),
255 DOM_KEY_MAP("MediaTrackNext", MEDIA_TRACK_NEXT),
256 DOM_KEY_MAP("MediaTrackPrevious", MEDIA_TRACK_PREVIOUS),
257 DOM_KEY_MAP("New", NEW),
258 DOM_KEY_MAP("Open", OPEN),
259 DOM_KEY_MAP("Print", PRINT),
260 DOM_KEY_MAP("Save", SAVE),
261 DOM_KEY_MAP("SpellCheck", SPELL_CHECK),
262 DOM_KEY_MAP("VolumeDown", VOLUME_DOWN),
263 DOM_KEY_MAP("VolumeUp", VOLUME_UP),
264 DOM_KEY_MAP("VolumeMute", VOLUME_MUTE),
266 // ======================================================
268 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-apps
269 // ======================================================
272 DOM_KEY_MAP("LaunchCalculator", LAUNCH_CALCULATOR), // Application 2
273 DOM_KEY_MAP("LaunchCalendar", LAUNCH_CALENDAR),
274 DOM_KEY_MAP("LaunchMail", LAUNCH_MAIL),
275 DOM_KEY_MAP("LaunchMediaPlayer", LAUNCH_MEDIA_PLAYER),
276 DOM_KEY_MAP("LaunchMusicPlayer", LAUNCH_MUSIC_PLAYER),
277 DOM_KEY_MAP("LaunchMyComputer", LAUNCH_MY_COMPUTER), // Application 1
278 DOM_KEY_MAP("LaunchScreenSaver", LAUNCH_SCREEN_SAVER),
279 DOM_KEY_MAP("LaunchSpreadsheet", LAUNCH_SPREADSHEET),
280 DOM_KEY_MAP("LaunchWebBrowser", LAUNCH_WEB_BROWSER),
281 DOM_KEY_MAP("LaunchWebCam", LAUNCH_WEB_CAM),
282 DOM_KEY_MAP("LaunchWordProcessor", LAUNCH_WORD_PROCESSOR),
284 // =========================================================
286 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-browser
287 // =========================================================
290 DOM_KEY_MAP("BrowserBack", BROWSER_BACK),
291 DOM_KEY_MAP("BrowserFavorites", BROWSER_FAVORITES),
292 DOM_KEY_MAP("BrowserForward", BROWSER_FORWARD),
293 DOM_KEY_MAP("BrowserHome", BROWSER_HOME),
294 DOM_KEY_MAP("BrowserRefresh", BROWSER_REFRESH),
295 DOM_KEY_MAP("BrowserSearch", BROWSER_SEARCH),
296 DOM_KEY_MAP("BrowserStop", BROWSER_STOP),
298 // ==================================================================
299 // Media Controller Keys
300 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-media-controller
301 // ==================================================================
304 DOM_KEY_MAP("AudioBalanceLeft", AUDIO_BALANCE_LEFT),
305 DOM_KEY_MAP("AudioBalanceRight", AUDIO_BALANCE_RIGHT),
306 DOM_KEY_MAP("AudioBassBoostDown", AUDIO_BASS_BOOST_DOWN),
307 DOM_KEY_MAP("AudioBassBoostUp", AUDIO_BASS_BOOST_UP),
308 DOM_KEY_MAP("AudioFaderFront", AUDIO_FADER_FRONT),
309 DOM_KEY_MAP("AudioFaderRear", AUDIO_FADER_REAR),
310 DOM_KEY_MAP("AudioSurroundModeNext",AUDIO_SURROUND_MODE_NEXT),
311 DOM_KEY_MAP("AVRInput", AVR_INPUT),
312 DOM_KEY_MAP("AVRPower", AVR_POWER),
313 DOM_KEY_MAP("ChannelDown", CHANNEL_DOWN),
314 DOM_KEY_MAP("ChannelUp", CHANNEL_UP),
315 DOM_KEY_MAP("ColorF0Red", COLOR_F0_RED),
316 DOM_KEY_MAP("ColorF1Green", COLOR_F1_GREEN),
317 DOM_KEY_MAP("ColorF2Yellow", COLOR_F2_YELLOW),
318 DOM_KEY_MAP("ColorF3Blue", COLOR_F3_BLUE),
319 DOM_KEY_MAP("ColorF4Grey", COLOR_F4_GREY),
320 DOM_KEY_MAP("ColorF5Brown", COLOR_F5_BROWN),
321 DOM_KEY_MAP("ClosedCaptionToggle", CLOSED_CAPTION_TOGGLE),
322 DOM_KEY_MAP("Dimmer", DIMMER),
323 DOM_KEY_MAP("DisplaySwap", DISPLAY_SWAP),
324 DOM_KEY_MAP("Exit", EXIT),
325 DOM_KEY_MAP("FavoriteClear0", FAVORITE_CLEAR0),
326 DOM_KEY_MAP("FavoriteClear1", FAVORITE_CLEAR1),
327 DOM_KEY_MAP("FavoriteClear2", FAVORITE_CLEAR2),
328 DOM_KEY_MAP("FavoriteClear3", FAVORITE_CLEAR3),
329 DOM_KEY_MAP("FavoriteRecall0", FAVORITE_RECALL0),
330 DOM_KEY_MAP("FavoriteRecall1", FAVORITE_RECALL1),
331 DOM_KEY_MAP("FavoriteRecall2", FAVORITE_RECALL2),
332 DOM_KEY_MAP("FavoriteRecall3", FAVORITE_RECALL3),
333 DOM_KEY_MAP("FavoriteStore0", FAVORITE_STORE0),
334 DOM_KEY_MAP("FavoriteStore1", FAVORITE_STORE1),
335 DOM_KEY_MAP("FavoriteStore2", FAVORITE_STORE2),
336 DOM_KEY_MAP("FavoriteStore3", FAVORITE_STORE3),
337 DOM_KEY_MAP("Guide", GUIDE),
338 DOM_KEY_MAP("GuideNextDay", GUIDE_NEXT_DAY),
339 DOM_KEY_MAP("GuidePreviousDay", GUIDE_PREVIOUS_DAY),
340 DOM_KEY_MAP("Info", INFO),
341 DOM_KEY_MAP("InstantReplay", INSTANT_REPLAY),
342 DOM_KEY_MAP("Link", LINK),
343 DOM_KEY_MAP("ListProgram", LIST_PROGRAM),
344 DOM_KEY_MAP("LiveContent", LIVE_CONTENT),
345 DOM_KEY_MAP("Lock", LOCK),
346 DOM_KEY_MAP("MediaApps", MEDIA_APPS),
347 DOM_KEY_MAP("MediaFastForward", MEDIA_FAST_FORWARD),
348 DOM_KEY_MAP("MediaLast", MEDIA_LAST),
349 DOM_KEY_MAP("MediaPause", MEDIA_PAUSE),
350 DOM_KEY_MAP("MediaPlay", MEDIA_PLAY),
351 DOM_KEY_MAP("MediaRecord", MEDIA_RECORD),
352 DOM_KEY_MAP("MediaRewind", MEDIA_REWIND),
353 DOM_KEY_MAP("MediaSkip", MEDIA_SKIP),
354 DOM_KEY_MAP("NextFavoriteChannel", NEXT_FAVORITE_CHANNEL),
355 DOM_KEY_MAP("NextUserProfile", NEXT_USER_PROFILE),
356 DOM_KEY_MAP("OnDemand", ON_DEMAND),
357 DOM_KEY_MAP("PinPDown", PINP_DOWN),
358 DOM_KEY_MAP("PinPMove", PINP_MOVE),
359 DOM_KEY_MAP("PinPToggle", PINP_TOGGLE),
360 DOM_KEY_MAP("PinPUp", PINP_UP),
361 DOM_KEY_MAP("PlaySpeedDown", PLAY_SPEED_DOWN),
362 DOM_KEY_MAP("PlaySpeedReset", PLAY_SPEED_RESET),
363 DOM_KEY_MAP("PlaySpeedUp", PLAY_SPEED_UP),
364 DOM_KEY_MAP("RandomToggle", RANDOM_TOGGLE),
365 DOM_KEY_MAP("RcLowBattery", RC_LOW_BATTERY),
366 DOM_KEY_MAP("RecordSpeedNext", RECORD_SPEED_NEXT),
367 DOM_KEY_MAP("RfBypass", RF_BYPASS),
368 DOM_KEY_MAP("ScanChannelsToggle", SCAN_CHANNELS_TOGGLE),
369 DOM_KEY_MAP("ScreenModeNext", SCREEN_MODE_NEXT),
370 DOM_KEY_MAP("Settings", SETTINGS),
371 DOM_KEY_MAP("SplitScreenToggle", SPLIT_SCREEN_TOGGLE),
372 DOM_KEY_MAP("STBInput", STB_INPUT),
373 DOM_KEY_MAP("STBPower", STB_POWER),
374 DOM_KEY_MAP("Subtitle", SUBTITLE),
375 DOM_KEY_MAP("Teletext", TELETEXT),
376 DOM_KEY_MAP("TV", T_V),
377 DOM_KEY_MAP("TVInput", TV_INPUT),
378 DOM_KEY_MAP("TVPower", TV_POWER),
379 DOM_KEY_MAP("VideoModeNext", VIDEO_MODE_NEXT),
380 DOM_KEY_MAP("Wink", WINK),
381 DOM_KEY_MAP("ZoomToggle", ZOOM_TOGGLE),