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 // ============================================================
69 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-whitespace
70 // ============================================================
73 DOM_KEY_MAP("Enter", ENTER
), // Enter, Return
74 DOM_KEY_MAP("Separator", SEPARATOR
),
75 DOM_KEY_MAP("Tab", TAB
),
77 // ============================================================
79 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-navigation
80 // ============================================================
83 DOM_KEY_MAP("ArrowDown", ARROW_DOWN
),
84 DOM_KEY_MAP("ArrowLeft", ARROW_LEFT
),
85 DOM_KEY_MAP("ArrowRight", ARROW_RIGHT
),
86 DOM_KEY_MAP("ArrowUp", ARROW_UP
),
87 DOM_KEY_MAP("End", END
),
88 DOM_KEY_MAP("Home", HOME
),
89 DOM_KEY_MAP("PageDown", PAGE_DOWN
),
90 DOM_KEY_MAP("PageUp", PAGE_UP
),
92 // =========================================================
94 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-editing
95 // =========================================================
98 DOM_KEY_MAP("Backspace", BACKSPACE
),
99 DOM_KEY_MAP("Clear", CLEAR
),
100 DOM_KEY_MAP("Copy", COPY
),
101 DOM_KEY_MAP("CrSel", CR_SEL
), // Cursor Select
102 DOM_KEY_MAP("Cut", CUT
),
103 // Delete (Forward Delete) named DEL because DELETE conflicts with <windows.h>
104 DOM_KEY_MAP("Delete", DEL
),
105 DOM_KEY_MAP("EraseEof", ERASE_EOF
), // Erase to End of Field
106 DOM_KEY_MAP("ExSel", EX_SEL
), // Extend Selection
107 DOM_KEY_MAP("Insert", INSERT
),
108 DOM_KEY_MAP("Paste", PASTE
),
109 DOM_KEY_MAP("Redo", REDO
),
110 DOM_KEY_MAP("Undo", UNDO
),
112 // ====================================================
114 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-ui
115 // ====================================================
118 DOM_KEY_MAP("Accept", ACCEPT
), // Accept current IME conversion
119 DOM_KEY_MAP("Again", AGAIN
), // Repeat an action
120 DOM_KEY_MAP("Attn", ATTN
), // Attention
121 DOM_KEY_MAP("Cancel", CANCEL
),
122 DOM_KEY_MAP("ContextMenu", CONTEXT_MENU
),
123 DOM_KEY_MAP("Escape", ESCAPE
),
124 DOM_KEY_MAP("Execute", EXECUTE
),
125 DOM_KEY_MAP("Find", FIND
),
126 DOM_KEY_MAP("Help", HELP
),
127 DOM_KEY_MAP("Pause", PAUSE
), // Program state - not for media
128 DOM_KEY_MAP("Play", PLAY
), // Program state - not for media
129 DOM_KEY_MAP("Props", PROPS
), // Properties
130 DOM_KEY_MAP("Select", SELECT
),
131 DOM_KEY_MAP("ZoomIn", ZOOM_IN
),
132 DOM_KEY_MAP("ZoomOut", ZOOM_OUT
),
134 // ========================================================
136 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-device
137 // ========================================================
140 DOM_KEY_MAP("BrightnessDown", BRIGHTNESS_DOWN
),
141 DOM_KEY_MAP("BrightnessUp", BRIGHTNESS_UP
),
142 DOM_KEY_MAP("Camera", CAMERA
),
143 DOM_KEY_MAP("Eject", EJECT
),
144 DOM_KEY_MAP("LogOff", LOG_OFF
),
145 DOM_KEY_MAP("Power", POWER
),
146 DOM_KEY_MAP("PowerOff", POWER_OFF
),
147 DOM_KEY_MAP("PrintScreen", PRINT_SCREEN
),
148 DOM_KEY_MAP("Hibernate", HIBERNATE
),
149 DOM_KEY_MAP("Standby", STANDBY
),
150 DOM_KEY_MAP("WakeUp", WAKE_UP
),
152 // =============================================================
153 // IME and Composition Keys
154 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-composition
155 // =============================================================
158 DOM_KEY_MAP("AllCandidates", ALL_CANDIDATES
),
159 DOM_KEY_MAP("Alphanumeric", ALPHANUMERIC
),
160 DOM_KEY_MAP("CodeInput", CODE_INPUT
),
161 DOM_KEY_MAP("Compose", COMPOSE
),
162 DOM_KEY_MAP("Convert", CONVERT
),
163 DOM_KEY_MAP("Dead", DEAD
),
164 DOM_KEY_MAP("FinalMode", FINAL_MODE
),
165 DOM_KEY_MAP("GroupFirst", GROUP_FIRST
),
166 DOM_KEY_MAP("GroupLast", GROUP_LAST
),
167 DOM_KEY_MAP("GroupNext", GROUP_NEXT
),
168 DOM_KEY_MAP("GroupPrevious", GROUP_PREVIOUS
),
169 DOM_KEY_MAP("ModeChange", MODE_CHANGE
),
170 DOM_KEY_MAP("NextCandidate", NEXT_CANDIDATE
),
171 DOM_KEY_MAP("NonConvert", NON_CONVERT
),
172 DOM_KEY_MAP("PreviousCandidate", PREVIOUS_CANDIDATE
),
173 DOM_KEY_MAP("Process", PROCESS
),
174 DOM_KEY_MAP("SingleCandidate", SINGLE_CANDIDATE
),
176 // Keys specific to Korean keyboards
177 DOM_KEY_MAP("HangulMode", HANGUL_MODE
),
178 DOM_KEY_MAP("HanjaMode", HANJA_MODE
),
179 DOM_KEY_MAP("JunjaMode", JUNJA_MODE
),
181 // Keys specific to Japanese keyboards
182 DOM_KEY_MAP("Eisu", EISU
),
183 DOM_KEY_MAP("Hankaku", HANKAKU
),
184 DOM_KEY_MAP("Hiragana", HIRAGANA
),
185 DOM_KEY_MAP("HiraganaKatakana", HIRAGANA_KATAKANA
),
186 DOM_KEY_MAP("KanaMode", KANA_MODE
),
187 DOM_KEY_MAP("KanjiMode", KANJI_MODE
),
188 DOM_KEY_MAP("Katakana", KATAKANA
),
189 DOM_KEY_MAP("Romaji", ROMAJI
),
190 DOM_KEY_MAP("Zenkaku", ZENKAKU
),
191 DOM_KEY_MAP("ZenkakuHankaku", ZENKAKU_HANKAKU
),
193 // ==========================================================
194 // General-Purpose Function Keys
195 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-function
196 // ==========================================================
198 // DOM defines open-ended sets, but if we want a finite numeric encoding we
199 // need to draw the line somewhere. USB and Windows (VK) and Linux (evdev)
200 // all support 24, so we define 24.
203 DOM_KEY_MAP("F1", F1
),
204 DOM_KEY_MAP("F2", F2
),
205 DOM_KEY_MAP("F3", F3
),
206 DOM_KEY_MAP("F4", F4
),
207 DOM_KEY_MAP("F5", F5
),
208 DOM_KEY_MAP("F6", F6
),
209 DOM_KEY_MAP("F7", F7
),
210 DOM_KEY_MAP("F8", F8
),
211 DOM_KEY_MAP("F9", F9
),
212 DOM_KEY_MAP("F10", F10
),
213 DOM_KEY_MAP("F11", F11
),
214 DOM_KEY_MAP("F12", F12
),
215 DOM_KEY_MAP("F13", F13
),
216 DOM_KEY_MAP("F14", F14
),
217 DOM_KEY_MAP("F15", F15
),
218 DOM_KEY_MAP("F16", F16
),
219 DOM_KEY_MAP("F17", F17
),
220 DOM_KEY_MAP("F18", F18
),
221 DOM_KEY_MAP("F19", F19
),
222 DOM_KEY_MAP("F20", F20
),
223 DOM_KEY_MAP("F21", F21
),
224 DOM_KEY_MAP("F22", F22
),
225 DOM_KEY_MAP("F23", F23
),
226 DOM_KEY_MAP("F24", F24
),
227 DOM_KEY_MAP("Soft1", SOFT1
),
228 DOM_KEY_MAP("Soft2", SOFT2
),
229 DOM_KEY_MAP("Soft3", SOFT3
),
230 DOM_KEY_MAP("Soft4", SOFT4
),
231 DOM_KEY_MAP("Soft5", SOFT5
),
232 DOM_KEY_MAP("Soft6", SOFT6
),
233 DOM_KEY_MAP("Soft7", SOFT7
),
234 DOM_KEY_MAP("Soft8", SOFT8
),
236 // ============================================================
238 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-multimedia
239 // ============================================================
242 DOM_KEY_MAP("Close", CLOSE
),
243 DOM_KEY_MAP("MailForward", MAIL_FORWARD
),
244 DOM_KEY_MAP("MailReply", MAIL_REPLY
),
245 DOM_KEY_MAP("MailSend", MAIL_SEND
),
246 DOM_KEY_MAP("MediaPlayPause", MEDIA_PLAY_PAUSE
),
247 DOM_KEY_MAP("MediaSelect", MEDIA_SELECT
),
248 DOM_KEY_MAP("MediaStop", MEDIA_STOP
),
249 DOM_KEY_MAP("MediaTrackNext", MEDIA_TRACK_NEXT
),
250 DOM_KEY_MAP("MediaTrackPrevious", MEDIA_TRACK_PREVIOUS
),
251 DOM_KEY_MAP("New", NEW
),
252 DOM_KEY_MAP("Open", OPEN
),
253 DOM_KEY_MAP("Print", PRINT
),
254 DOM_KEY_MAP("Save", SAVE
),
255 DOM_KEY_MAP("SpellCheck", SPELL_CHECK
),
256 DOM_KEY_MAP("VolumeDown", VOLUME_DOWN
),
257 DOM_KEY_MAP("VolumeUp", VOLUME_UP
),
258 DOM_KEY_MAP("VolumeMute", VOLUME_MUTE
),
260 // ======================================================
262 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-apps
263 // ======================================================
266 DOM_KEY_MAP("LaunchCalculator", LAUNCH_CALCULATOR
), // Application 2
267 DOM_KEY_MAP("LaunchCalendar", LAUNCH_CALENDAR
),
268 DOM_KEY_MAP("LaunchMail", LAUNCH_MAIL
),
269 DOM_KEY_MAP("LaunchMediaPlayer", LAUNCH_MEDIA_PLAYER
),
270 DOM_KEY_MAP("LaunchMusicPlayer", LAUNCH_MUSIC_PLAYER
),
271 DOM_KEY_MAP("LaunchMyComputer", LAUNCH_MY_COMPUTER
), // Application 1
272 DOM_KEY_MAP("LaunchScreenSaver", LAUNCH_SCREEN_SAVER
),
273 DOM_KEY_MAP("LaunchSpreadsheet", LAUNCH_SPREADSHEET
),
274 DOM_KEY_MAP("LaunchWebBrowser", LAUNCH_WEB_BROWSER
),
275 DOM_KEY_MAP("LaunchWebCam", LAUNCH_WEB_CAM
),
276 DOM_KEY_MAP("LaunchWordProcessor", LAUNCH_WORD_PROCESSOR
),
278 // =========================================================
280 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-browser
281 // =========================================================
284 DOM_KEY_MAP("BrowserBack", BROWSER_BACK
),
285 DOM_KEY_MAP("BrowserFavorites", BROWSER_FAVORITES
),
286 DOM_KEY_MAP("BrowserForward", BROWSER_FORWARD
),
287 DOM_KEY_MAP("BrowserHome", BROWSER_HOME
),
288 DOM_KEY_MAP("BrowserRefresh", BROWSER_REFRESH
),
289 DOM_KEY_MAP("BrowserSearch", BROWSER_SEARCH
),
290 DOM_KEY_MAP("BrowserStop", BROWSER_STOP
),
292 // ==================================================================
293 // Media Controller Keys
294 // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-media-controller
295 // ==================================================================
298 DOM_KEY_MAP("AudioBalanceLeft", AUDIO_BALANCE_LEFT
),
299 DOM_KEY_MAP("AudioBalanceRight", AUDIO_BALANCE_RIGHT
),
300 DOM_KEY_MAP("AudioBassBoostDown", AUDIO_BASS_BOOST_DOWN
),
301 DOM_KEY_MAP("AudioBassBoostUp", AUDIO_BASS_BOOST_UP
),
302 DOM_KEY_MAP("AudioFaderFront", AUDIO_FADER_FRONT
),
303 DOM_KEY_MAP("AudioFaderRear", AUDIO_FADER_REAR
),
304 DOM_KEY_MAP("AudioSurroundModeNext",AUDIO_SURROUND_MODE_NEXT
),
305 DOM_KEY_MAP("AVRInput", AVR_INPUT
),
306 DOM_KEY_MAP("AVRPower", AVR_POWER
),
307 DOM_KEY_MAP("ChannelDown", CHANNEL_DOWN
),
308 DOM_KEY_MAP("ChannelUp", CHANNEL_UP
),
309 DOM_KEY_MAP("ColorF0Red", COLOR_F0_RED
),
310 DOM_KEY_MAP("ColorF1Green", COLOR_F1_GREEN
),
311 DOM_KEY_MAP("ColorF2Yellow", COLOR_F2_YELLOW
),
312 DOM_KEY_MAP("ColorF3Blue", COLOR_F3_BLUE
),
313 DOM_KEY_MAP("ColorF4Grey", COLOR_F4_GREY
),
314 DOM_KEY_MAP("ColorF5Brown", COLOR_F5_BROWN
),
315 DOM_KEY_MAP("ClosedCaptionToggle", CLOSED_CAPTION_TOGGLE
),
316 DOM_KEY_MAP("Dimmer", DIMMER
),
317 DOM_KEY_MAP("DisplaySwap", DISPLAY_SWAP
),
318 DOM_KEY_MAP("Exit", EXIT
),
319 DOM_KEY_MAP("FavoriteClear0", FAVORITE_CLEAR0
),
320 DOM_KEY_MAP("FavoriteClear1", FAVORITE_CLEAR1
),
321 DOM_KEY_MAP("FavoriteClear2", FAVORITE_CLEAR2
),
322 DOM_KEY_MAP("FavoriteClear3", FAVORITE_CLEAR3
),
323 DOM_KEY_MAP("FavoriteRecall0", FAVORITE_RECALL0
),
324 DOM_KEY_MAP("FavoriteRecall1", FAVORITE_RECALL1
),
325 DOM_KEY_MAP("FavoriteRecall2", FAVORITE_RECALL2
),
326 DOM_KEY_MAP("FavoriteRecall3", FAVORITE_RECALL3
),
327 DOM_KEY_MAP("FavoriteStore0", FAVORITE_STORE0
),
328 DOM_KEY_MAP("FavoriteStore1", FAVORITE_STORE1
),
329 DOM_KEY_MAP("FavoriteStore2", FAVORITE_STORE2
),
330 DOM_KEY_MAP("FavoriteStore3", FAVORITE_STORE3
),
331 DOM_KEY_MAP("Guide", GUIDE
),
332 DOM_KEY_MAP("GuideNextDay", GUIDE_NEXT_DAY
),
333 DOM_KEY_MAP("GuidePreviousDay", GUIDE_PREVIOUS_DAY
),
334 DOM_KEY_MAP("Info", INFO
),
335 DOM_KEY_MAP("InstantReplay", INSTANT_REPLAY
),
336 DOM_KEY_MAP("Link", LINK
),
337 DOM_KEY_MAP("ListProgram", LIST_PROGRAM
),
338 DOM_KEY_MAP("LiveContent", LIVE_CONTENT
),
339 DOM_KEY_MAP("Lock", LOCK
),
340 DOM_KEY_MAP("MediaApps", MEDIA_APPS
),
341 DOM_KEY_MAP("MediaFastForward", MEDIA_FAST_FORWARD
),
342 DOM_KEY_MAP("MediaLast", MEDIA_LAST
),
343 DOM_KEY_MAP("MediaPause", MEDIA_PAUSE
),
344 DOM_KEY_MAP("MediaPlay", MEDIA_PLAY
),
345 DOM_KEY_MAP("MediaRecord", MEDIA_RECORD
),
346 DOM_KEY_MAP("MediaRewind", MEDIA_REWIND
),
347 DOM_KEY_MAP("MediaSkip", MEDIA_SKIP
),
348 DOM_KEY_MAP("NextFavoriteChannel", NEXT_FAVORITE_CHANNEL
),
349 DOM_KEY_MAP("NextUserProfile", NEXT_USER_PROFILE
),
350 DOM_KEY_MAP("OnDemand", ON_DEMAND
),
351 DOM_KEY_MAP("PinPDown", PINP_DOWN
),
352 DOM_KEY_MAP("PinPMove", PINP_MOVE
),
353 DOM_KEY_MAP("PinPToggle", PINP_TOGGLE
),
354 DOM_KEY_MAP("PinPUp", PINP_UP
),
355 DOM_KEY_MAP("PlaySpeedDown", PLAY_SPEED_DOWN
),
356 DOM_KEY_MAP("PlaySpeedReset", PLAY_SPEED_RESET
),
357 DOM_KEY_MAP("PlaySpeedUp", PLAY_SPEED_UP
),
358 DOM_KEY_MAP("RandomToggle", RANDOM_TOGGLE
),
359 DOM_KEY_MAP("RcLowBattery", RC_LOW_BATTERY
),
360 DOM_KEY_MAP("RecordSpeedNext", RECORD_SPEED_NEXT
),
361 DOM_KEY_MAP("RfBypass", RF_BYPASS
),
362 DOM_KEY_MAP("ScanChannelsToggle", SCAN_CHANNELS_TOGGLE
),
363 DOM_KEY_MAP("ScreenModeNext", SCREEN_MODE_NEXT
),
364 DOM_KEY_MAP("Settings", SETTINGS
),
365 DOM_KEY_MAP("SplitScreenToggle", SPLIT_SCREEN_TOGGLE
),
366 DOM_KEY_MAP("STBInput", STB_INPUT
),
367 DOM_KEY_MAP("STBPower", STB_POWER
),
368 DOM_KEY_MAP("Subtitle", SUBTITLE
),
369 DOM_KEY_MAP("Teletext", TELETEXT
),
370 DOM_KEY_MAP("TV", T_V
),
371 DOM_KEY_MAP("TVInput", TV_INPUT
),
372 DOM_KEY_MAP("TVPower", TV_POWER
),
373 DOM_KEY_MAP("VideoModeNext", VIDEO_MODE_NEXT
),
374 DOM_KEY_MAP("Wink", WINK
),
375 DOM_KEY_MAP("ZoomToggle", ZOOM_TOGGLE
),