1 // Copyright 2013 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 USB_KEYMAP and USB_KEYMAP_DECLARATION.
9 // Data in this file was created by referencing:
10 // [0] USB HID Usage Tables,
11 // http://www.usb.org/developers/hidpage/Hut1_12v2.pdf
12 // [1] DOM Level 3 KeyboardEvent code Values,
13 // http://www.w3.org/TR/DOM-Level-3-Events-code/
14 // [2] OS X <HIToolbox/Events.h>
15 // [3] Linux <linux/input.h> and hid-input.c
17 USB_KEYMAP_DECLARATION
{
19 // USB XKB Win Mac Code
20 USB_KEYMAP(0x000000, 0x0000, 0x0000, 0xffff, NULL
, NONE
), // Invalid
22 // =========================================
24 // =========================================
26 // USB XKB Win Mac Code
27 USB_KEYMAP(0x000010, 0x0000, 0x0000, 0xffff, "Hyper", HYPER
),
28 USB_KEYMAP(0x000011, 0x0000, 0x0000, 0xffff, "Super", SUPER
),
29 USB_KEYMAP(0x000012, 0x0000, 0x0000, 0xffff, "Fn", FN
),
30 // FLock is named FN_LOCK because F_LOCK conflicts with <fcntl.h>
31 USB_KEYMAP(0x000013, 0x0000, 0x0000, 0xffff, "FLock", FN_LOCK
),
32 USB_KEYMAP(0x000014, 0x0000, 0x0000, 0xffff, "Suspend", SUSPEND
),
33 USB_KEYMAP(0x000015, 0x0000, 0x0000, 0xffff, "Resume", RESUME
),
34 USB_KEYMAP(0x000016, 0x0000, 0x0000, 0xffff, "Turbo", TURBO
),
36 // =========================================
37 // USB Usage Page 0x01: Generic Desktop Page
38 // =========================================
40 // Sleep could be encoded as USB#0c0032, but there's no corresponding WakeUp
41 // in the 0x0c USB page.
44 USB_KEYMAP(0x010082, 0x0096, 0x0000, 0xffff, "Sleep", SLEEP
), // SystemSleep
45 USB_KEYMAP(0x010083, 0x0097, 0x0000, 0xffff, "WakeUp", WAKE_UP
),
47 // =========================================
48 // USB Usage Page 0x07: Keyboard/Keypad Page
49 // =========================================
52 // XKB#005c ISO Level3 Shift (AltGr)
55 // XKB#008a SunProps cf. USB#0700a3 CrSel/Props
57 // Mac#003f kVK_Function
58 // Mac#000a kVK_ISO_Section (ISO keyboards only)
59 // Mac#0066 kVK_JIS_Eisu (USB#07008a Henkan?)
62 USB_KEYMAP(0x070000, 0x0000, 0x0000, 0xffff, NULL
, USB_RESERVED
),
63 USB_KEYMAP(0x070001, 0x0000, 0x0000, 0xffff, NULL
, USB_ERROR_ROLL_OVER
),
64 USB_KEYMAP(0x070002, 0x0000, 0x0000, 0xffff, NULL
, USB_POST_FAIL
),
65 USB_KEYMAP(0x070003, 0x0000, 0x0000, 0xffff, NULL
, USB_ERROR_UNDEFINED
),
66 USB_KEYMAP(0x070004, 0x0026, 0x001e, 0x0000, "KeyA", KEY_A
), // aA
67 USB_KEYMAP(0x070005, 0x0038, 0x0030, 0x000b, "KeyB", KEY_B
), // bB
68 USB_KEYMAP(0x070006, 0x0036, 0x002e, 0x0008, "KeyC", KEY_C
), // cC
69 USB_KEYMAP(0x070007, 0x0028, 0x0020, 0x0002, "KeyD", KEY_D
), // dD
71 USB_KEYMAP(0x070008, 0x001a, 0x0012, 0x000e, "KeyE", KEY_E
), // eE
72 USB_KEYMAP(0x070009, 0x0029, 0x0021, 0x0003, "KeyF", KEY_F
), // fF
73 USB_KEYMAP(0x07000a, 0x002a, 0x0022, 0x0005, "KeyG", KEY_G
), // gG
74 USB_KEYMAP(0x07000b, 0x002b, 0x0023, 0x0004, "KeyH", KEY_H
), // hH
75 USB_KEYMAP(0x07000c, 0x001f, 0x0017, 0x0022, "KeyI", KEY_I
), // iI
76 USB_KEYMAP(0x07000d, 0x002c, 0x0024, 0x0026, "KeyJ", KEY_J
), // jJ
77 USB_KEYMAP(0x07000e, 0x002d, 0x0025, 0x0028, "KeyK", KEY_K
), // kK
78 USB_KEYMAP(0x07000f, 0x002e, 0x0026, 0x0025, "KeyL", KEY_L
), // lL
80 USB_KEYMAP(0x070010, 0x003a, 0x0032, 0x002e, "KeyM", KEY_M
), // mM
81 USB_KEYMAP(0x070011, 0x0039, 0x0031, 0x002d, "KeyN", KEY_N
), // nN
82 USB_KEYMAP(0x070012, 0x0020, 0x0018, 0x001f, "KeyO", KEY_O
), // oO
83 USB_KEYMAP(0x070013, 0x0021, 0x0019, 0x0023, "KeyP", KEY_P
), // pP
84 USB_KEYMAP(0x070014, 0x0018, 0x0010, 0x000c, "KeyQ", KEY_Q
), // qQ
85 USB_KEYMAP(0x070015, 0x001b, 0x0013, 0x000f, "KeyR", KEY_R
), // rR
86 USB_KEYMAP(0x070016, 0x0027, 0x001f, 0x0001, "KeyS", KEY_S
), // sS
87 USB_KEYMAP(0x070017, 0x001c, 0x0014, 0x0011, "KeyT", KEY_T
), // tT
89 USB_KEYMAP(0x070018, 0x001e, 0x0016, 0x0020, "KeyU", KEY_U
), // uU
90 USB_KEYMAP(0x070019, 0x0037, 0x002f, 0x0009, "KeyV", KEY_V
), // vV
91 USB_KEYMAP(0x07001a, 0x0019, 0x0011, 0x000d, "KeyW", KEY_W
), // wW
92 USB_KEYMAP(0x07001b, 0x0035, 0x002d, 0x0007, "KeyX", KEY_X
), // xX
93 USB_KEYMAP(0x07001c, 0x001d, 0x0015, 0x0010, "KeyY", KEY_Y
), // yY
94 USB_KEYMAP(0x07001d, 0x0034, 0x002c, 0x0006, "KeyZ", KEY_Z
), // zZ
95 USB_KEYMAP(0x07001e, 0x000a, 0x0002, 0x0012, "Digit1", DIGIT1
), // 1!
96 USB_KEYMAP(0x07001f, 0x000b, 0x0003, 0x0013, "Digit2", DIGIT2
), // 2@
98 USB_KEYMAP(0x070020, 0x000c, 0x0004, 0x0014, "Digit3", DIGIT3
), // 3#
99 USB_KEYMAP(0x070021, 0x000d, 0x0005, 0x0015, "Digit4", DIGIT4
), // 4$
100 USB_KEYMAP(0x070022, 0x000e, 0x0006, 0x0017, "Digit5", DIGIT5
), // 5%
101 USB_KEYMAP(0x070023, 0x000f, 0x0007, 0x0016, "Digit6", DIGIT6
), // 6^
102 USB_KEYMAP(0x070024, 0x0010, 0x0008, 0x001a, "Digit7", DIGIT7
), // 7&
103 USB_KEYMAP(0x070025, 0x0011, 0x0009, 0x001c, "Digit8", DIGIT8
), // 8*
104 USB_KEYMAP(0x070026, 0x0012, 0x000a, 0x0019, "Digit9", DIGIT9
), // 9(
105 USB_KEYMAP(0x070027, 0x0013, 0x000b, 0x001d, "Digit0", DIGIT0
), // 0)
107 USB_KEYMAP(0x070028, 0x0024, 0x001c, 0x0024, "Enter", ENTER
),
108 USB_KEYMAP(0x070029, 0x0009, 0x0001, 0x0035, "Escape", ESCAPE
),
109 USB_KEYMAP(0x07002a, 0x0016, 0x000e, 0x0033, "Backspace", BACKSPACE
),
110 USB_KEYMAP(0x07002b, 0x0017, 0x000f, 0x0030, "Tab", TAB
),
111 USB_KEYMAP(0x07002c, 0x0041, 0x0039, 0x0031, "Space", SPACE
), // Spacebar
112 USB_KEYMAP(0x07002d, 0x0014, 0x000c, 0x001b, "Minus", MINUS
), // -_
113 USB_KEYMAP(0x07002e, 0x0015, 0x000d, 0x0018, "Equal", EQUAL
), // =+
114 USB_KEYMAP(0x07002f, 0x0022, 0x001a, 0x0021, "BracketLeft", BRACKET_LEFT
),
116 USB_KEYMAP(0x070030, 0x0023, 0x001b, 0x001e, "BracketRight", BRACKET_RIGHT
),
117 USB_KEYMAP(0x070031, 0x0033, 0x002b, 0x002a, "Backslash", BACKSLASH
), // \|
118 // USB#070032 never appears on keyboards that have USB#070031.
119 // Platforms use the same scancode as for the two keys.
120 // The keycap varies on international keyboards:
121 // Dan: '* Dutch: <> Ger: #' UK: #~
122 // TODO(garykac): Verify Mac intl keyboard.
123 //USB_KEYMAP(0x070032, 0x0033, 0x002b, 0x002a, "IntlHash", INTL_HASH),
124 USB_KEYMAP(0x070033, 0x002f, 0x0027, 0x0029, "Semicolon", SEMICOLON
), // ;:
125 USB_KEYMAP(0x070034, 0x0030, 0x0028, 0x0027, "Quote", QUOTE
), // '"
126 USB_KEYMAP(0x070035, 0x0031, 0x0029, 0x0032, "Backquote", BACKQUOTE
), // `~
127 USB_KEYMAP(0x070036, 0x003b, 0x0033, 0x002b, "Comma", COMMA
), // ,<
128 USB_KEYMAP(0x070037, 0x003c, 0x0034, 0x002f, "Period", PERIOD
), // .>
130 USB_KEYMAP(0x070038, 0x003d, 0x0035, 0x002c, "Slash", SLASH
), // /?
131 // TODO(garykac): CapsLock requires special handling for each platform.
132 USB_KEYMAP(0x070039, 0x0042, 0x003a, 0x0039, "CapsLock", CAPS_LOCK
),
133 USB_KEYMAP(0x07003a, 0x0043, 0x003b, 0x007a, "F1", F1
),
134 USB_KEYMAP(0x07003b, 0x0044, 0x003c, 0x0078, "F2", F2
),
135 USB_KEYMAP(0x07003c, 0x0045, 0x003d, 0x0063, "F3", F3
),
136 USB_KEYMAP(0x07003d, 0x0046, 0x003e, 0x0076, "F4", F4
),
137 USB_KEYMAP(0x07003e, 0x0047, 0x003f, 0x0060, "F5", F5
),
138 USB_KEYMAP(0x07003f, 0x0048, 0x0040, 0x0061, "F6", F6
),
140 USB_KEYMAP(0x070040, 0x0049, 0x0041, 0x0062, "F7", F7
),
141 USB_KEYMAP(0x070041, 0x004a, 0x0042, 0x0064, "F8", F8
),
142 USB_KEYMAP(0x070042, 0x004b, 0x0043, 0x0065, "F9", F9
),
143 USB_KEYMAP(0x070043, 0x004c, 0x0044, 0x006d, "F10", F10
),
144 USB_KEYMAP(0x070044, 0x005f, 0x0057, 0x0067, "F11", F11
),
145 USB_KEYMAP(0x070045, 0x0060, 0x0058, 0x006f, "F12", F12
),
146 // PrintScreen is effectively F13 on Mac OS X.
147 USB_KEYMAP(0x070046, 0x006b, 0xe037, 0xffff, "PrintScreen", PRINT_SCREEN
),
148 USB_KEYMAP(0x070047, 0x004e, 0x0046, 0xffff, "ScrollLock", SCROLL_LOCK
),
150 USB_KEYMAP(0x070048, 0x007f, 0x0000, 0xffff, "Pause", PAUSE
),
151 // Labeled "Help/Insert" on Mac.
152 USB_KEYMAP(0x070049, 0x0076, 0xe052, 0x0072, "Insert", INSERT
),
153 USB_KEYMAP(0x07004a, 0x006e, 0xe047, 0x0073, "Home", HOME
),
154 USB_KEYMAP(0x07004b, 0x0070, 0xe049, 0x0074, "PageUp", PAGE_UP
),
155 // Delete (Forward Delete) named DEL because DELETE conflicts with <windows.h>
156 USB_KEYMAP(0x07004c, 0x0077, 0xe053, 0x0075, "Delete", DEL
),
157 USB_KEYMAP(0x07004d, 0x0073, 0xe04f, 0x0077, "End", END
),
158 USB_KEYMAP(0x07004e, 0x0075, 0xe051, 0x0079, "PageDown", PAGE_DOWN
),
159 USB_KEYMAP(0x07004f, 0x0072, 0xe04d, 0x007c, "ArrowRight", ARROW_RIGHT
),
161 USB_KEYMAP(0x070050, 0x0071, 0xe04b, 0x007b, "ArrowLeft", ARROW_LEFT
),
162 USB_KEYMAP(0x070051, 0x0074, 0xe050, 0x007d, "ArrowDown", ARROW_DOWN
),
163 USB_KEYMAP(0x070052, 0x006f, 0xe048, 0x007e, "ArrowUp", ARROW_UP
),
164 USB_KEYMAP(0x070053, 0x004d, 0x0045, 0x0047, "NumLock", NUM_LOCK
),
165 USB_KEYMAP(0x070054, 0x006a, 0xe035, 0x004b, "NumpadDivide", NUMPAD_DIVIDE
),
166 USB_KEYMAP(0x070055, 0x003f, 0x0037, 0x0043, "NumpadMultiply",
167 NUMPAD_MULTIPLY
), // Keypad_*
168 USB_KEYMAP(0x070056, 0x0052, 0x004a, 0x004e, "NumpadSubtract",
169 NUMPAD_SUBTRACT
), // Keypad_-
170 USB_KEYMAP(0x070057, 0x0056, 0x004e, 0x0045, "NumpadAdd", NUMPAD_ADD
),
172 USB_KEYMAP(0x070058, 0x0068, 0xe01c, 0x004c, "NumpadEnter", NUMPAD_ENTER
),
173 USB_KEYMAP(0x070059, 0x0057, 0x004f, 0x0053, "Numpad1", NUMPAD1
), // +End
174 USB_KEYMAP(0x07005a, 0x0058, 0x0050, 0x0054, "Numpad2", NUMPAD2
), // +Down
175 USB_KEYMAP(0x07005b, 0x0059, 0x0051, 0x0055, "Numpad3", NUMPAD3
), // +PageDn
176 USB_KEYMAP(0x07005c, 0x0053, 0x004b, 0x0056, "Numpad4", NUMPAD4
), // +Left
177 USB_KEYMAP(0x07005d, 0x0054, 0x004c, 0x0057, "Numpad5", NUMPAD5
), //
178 USB_KEYMAP(0x07005e, 0x0055, 0x004d, 0x0058, "Numpad6", NUMPAD6
), // +Right
179 USB_KEYMAP(0x07005f, 0x004f, 0x0047, 0x0059, "Numpad7", NUMPAD7
), // +Home
181 USB_KEYMAP(0x070060, 0x0050, 0x0048, 0x005b, "Numpad8", NUMPAD8
), // +Up
182 USB_KEYMAP(0x070061, 0x0051, 0x0049, 0x005c, "Numpad9", NUMPAD9
), // +PageUp
183 USB_KEYMAP(0x070062, 0x005a, 0x0052, 0x0052, "Numpad0", NUMPAD0
), // +Insert
184 USB_KEYMAP(0x070063, 0x005b, 0x0053, 0x0041, "NumpadDecimal",
185 NUMPAD_DECIMAL
), // Keypad_. Delete
186 // USB#070064 is not present on US keyboard.
187 // This key is typically located near LeftShift key.
188 // The keycap varies on international keyboards:
189 // Dan: <> Dutch: ][ Ger: <> UK: \|
190 USB_KEYMAP(0x070064, 0x005e, 0x0056, 0x000a, "IntlBackslash", INTL_BACKSLASH
),
191 // AppMenu (next to RWin key)
192 USB_KEYMAP(0x070065, 0x0087, 0xe05d, 0x006e, "ContextMenu", CONTEXT_MENU
),
193 USB_KEYMAP(0x070066, 0x007c, 0x0000, 0xffff, "Power", POWER
),
194 USB_KEYMAP(0x070067, 0x007d, 0x0000, 0x0051, "NumpadEqual", NUMPAD_EQUAL
),
196 USB_KEYMAP(0x070068, 0x0000, 0x005b, 0x0069, "F13", F13
),
197 USB_KEYMAP(0x070069, 0x0000, 0x005c, 0x006b, "F14", F14
),
198 USB_KEYMAP(0x07006a, 0x0000, 0x005d, 0x0071, "F15", F15
),
199 USB_KEYMAP(0x07006b, 0x0000, 0x0063, 0x006a, "F16", F16
),
200 USB_KEYMAP(0x07006c, 0x0000, 0x0064, 0x0040, "F17", F17
),
201 USB_KEYMAP(0x07006d, 0x0000, 0x0065, 0x004f, "F18", F18
),
202 USB_KEYMAP(0x07006e, 0x0000, 0x0066, 0x0050, "F19", F19
),
203 USB_KEYMAP(0x07006f, 0x0000, 0x0067, 0x005a, "F20", F20
),
205 USB_KEYMAP(0x070070, 0x0000, 0x0068, 0xffff, "F21", F21
),
206 USB_KEYMAP(0x070071, 0x0000, 0x0069, 0xffff, "F22", F22
),
207 USB_KEYMAP(0x070072, 0x0000, 0x006a, 0xffff, "F23", F23
),
208 USB_KEYMAP(0x070073, 0x0000, 0x006b, 0xffff, "F24", F24
),
209 USB_KEYMAP(0x070074, 0x0000, 0x0000, 0xffff, "Open", OPEN
), // Execute
210 USB_KEYMAP(0x070075, 0x0092, 0xe03b, 0xffff, "Help", HELP
),
211 USB_KEYMAP(0x070076, 0x0093, 0x0000, 0xffff, NULL
, MENU
), // Menu
212 USB_KEYMAP(0x070077, 0x0000, 0x0000, 0xffff, "Select", SELECT
), // Select
214 //USB_KEYMAP(0x070078, 0x0000, 0x0000, 0xffff, NULL, STOP), // Stop
215 USB_KEYMAP(0x070079, 0x0089, 0x0000, 0xffff, "Again", AGAIN
), // Again
216 USB_KEYMAP(0x07007a, 0x008b, 0xe008, 0xffff, "Undo", UNDO
),
217 USB_KEYMAP(0x07007b, 0x0091, 0xe017, 0xffff, "Cut", CUT
),
218 USB_KEYMAP(0x07007c, 0x008d, 0xe018, 0xffff, "Copy", COPY
),
219 USB_KEYMAP(0x07007d, 0x008f, 0xe00a, 0xffff, "Paste", PASTE
),
220 USB_KEYMAP(0x07007e, 0x0090, 0x0000, 0xffff, "Find", FIND
), // Find
221 USB_KEYMAP(0x07007f, 0x0079, 0xe020, 0x004a, "VolumeMute", VOLUME_MUTE
),
223 USB_KEYMAP(0x070080, 0x007b, 0xe030, 0x0048, "VolumeUp", VOLUME_UP
),
224 USB_KEYMAP(0x070081, 0x007a, 0xe02e, 0x0049, "VolumeDown", VOLUME_DOWN
),
225 //USB_KEYMAP(0x070082, 0x0000, 0x0000, 0xffff, NULL, LOCKING_CAPS_LOCK),
226 //USB_KEYMAP(0x070083, 0x0000, 0x0000, 0xffff, NULL, LOCKING_NUM_LOCK),
227 //USB_KEYMAP(0x070084, 0x0000, 0x0000, 0xffff, NULL, LOCKING_SCROLL_LOCK),
228 // USB#070085 is used as Brazilian Keypad_.
229 USB_KEYMAP(0x070085, 0x0000, 0x0000, 0x005f, "NumpadComma", NUMPAD_COMMA
),
232 // USB#070086 is used on AS/400 keyboards. Standard Keypad_= is USB#070067.
233 //USB_KEYMAP(0x070086, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_EQUAL),
234 // USB#070087 is used for Brazilian /? and Japanese _ 'ro'.
235 USB_KEYMAP(0x070087, 0x0061, 0x0000, 0x005e, "IntlRo", INTL_RO
),
237 // USB#070088 is used as Japanese Hiragana/Katakana key.
238 USB_KEYMAP(0x070088, 0x0065, 0x0000, 0x0068, "KanaMode", KANA_MODE
),
240 // USB#070089 is used as Japanese Yen key.
241 USB_KEYMAP(0x070089, 0x0084, 0x007d, 0x005d, "IntlYen", INTL_YEN
),
243 // USB#07008a is used as Japanese Henkan (Convert) key.
244 USB_KEYMAP(0x07008a, 0x0064, 0x0000, 0xffff, "Convert", CONVERT
),
246 // USB#07008b is used as Japanese Muhenkan (No-convert) key.
247 USB_KEYMAP(0x07008b, 0x0066, 0x0000, 0xffff, "NonConvert", NON_CONVERT
),
248 //USB_KEYMAP(0x07008c, 0x0000, 0x0000, 0xffff, NULL, INTERNATIONAL6),
249 //USB_KEYMAP(0x07008d, 0x0000, 0x0000, 0xffff, NULL, INTERNATIONAL7),
250 //USB_KEYMAP(0x07008e, 0x0000, 0x0000, 0xffff, NULL, INTERNATIONAL8),
251 //USB_KEYMAP(0x07008f, 0x0000, 0x0000, 0xffff, NULL, INTERNATIONAL9),
254 // USB#070090 is used as Korean Hangul/English toggle key.
255 USB_KEYMAP(0x070090, 0x0082, 0x0000, 0xffff, "Lang1", LANG1
),
257 // USB#070091 is used as Korean Hanja conversion key.
258 USB_KEYMAP(0x070091, 0x0083, 0x0000, 0xffff, "Lang2", LANG2
),
260 // USB#070092 is used as Japanese Katakana key.
261 USB_KEYMAP(0x070092, 0x0062, 0x0000, 0xffff, "Lang3", LANG3
),
263 // USB#070093 is used as Japanese Hiragana key.
264 USB_KEYMAP(0x070093, 0x0063, 0x0000, 0xffff, "Lang4", LANG4
),
266 // USB#070094 is used as Japanese Zenkaku/Hankaku (Fullwidth/halfwidth) key.
267 USB_KEYMAP(0x070094, 0x0000, 0x0000, 0xffff, "Lang5", LANG5
),
268 //USB_KEYMAP(0x070095, 0x0000, 0x0000, 0xffff, NULL, LANG6), // LANG6
269 //USB_KEYMAP(0x070096, 0x0000, 0x0000, 0xffff, NULL, LANG7), // LANG7
270 //USB_KEYMAP(0x070097, 0x0000, 0x0000, 0xffff, NULL, LANG8), // LANG8
271 //USB_KEYMAP(0x070098, 0x0000, 0x0000, 0xffff, NULL, LANG9), // LANG9
273 //USB_KEYMAP(0x070099, 0x0000, 0x0000, 0xffff, NULL, ALTERNATE_ERASE),
274 //USB_KEYMAP(0x07009a, 0x0000, 0x0000, 0xffff, NULL, SYS_REQ), // /Attention
275 USB_KEYMAP(0x07009b, 0x0088, 0x0000, 0xffff, "Abort", ABORT
), // Cancel
276 //USB_KEYMAP(0x07009c, 0x0000, 0x0000, 0xffff, NULL, CLEAR), // Clear
277 //USB_KEYMAP(0x07009d, 0x0000, 0x0000, 0xffff, NULL, PRIOR), // Prior
278 //USB_KEYMAP(0x07009e, 0x0000, 0x0000, 0xffff, NULL, RETURN), // Return
279 //USB_KEYMAP(0x07009f, 0x0000, 0x0000, 0xffff, NULL, SEPARATOR), // Separator
281 //USB_KEYMAP(0x0700a0, 0x0000, 0x0000, 0xffff, NULL, OUT), // Out
282 //USB_KEYMAP(0x0700a1, 0x0000, 0x0000, 0xffff, NULL, OPER), // Oper
283 //USB_KEYMAP(0x0700a2, 0x0000, 0x0000, 0xffff, NULL, CLEAR_AGAIN),
284 USB_KEYMAP(0x0700a3, 0x0000, 0x0000, 0xffff, "Props", PROPS
), // CrSel/Props
285 //USB_KEYMAP(0x0700a4, 0x0000, 0x0000, 0xffff, NULL, EX_SEL), // ExSel
287 //USB_KEYMAP(0x0700b0, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_00),
288 //USB_KEYMAP(0x0700b1, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_000),
289 //USB_KEYMAP(0x0700b2, 0x0000, 0x0000, 0xffff, NULL, THOUSANDS_SEPARATOR),
290 //USB_KEYMAP(0x0700b3, 0x0000, 0x0000, 0xffff, NULL, DECIMAL_SEPARATOR),
291 //USB_KEYMAP(0x0700b4, 0x0000, 0x0000, 0xffff, NULL, CURRENCY_UNIT),
292 //USB_KEYMAP(0x0700b5, 0x0000, 0x0000, 0xffff, NULL, CURRENCY_SUBUNIT),
293 USB_KEYMAP(0x0700b6, 0x00bb, 0x0000, 0xffff, "NumpadParenLeft",
294 NUMPAD_PAREN_LEFT
), // Keypad_(
295 USB_KEYMAP(0x0700b7, 0x00bc, 0x0000, 0xffff, "NumpadParenRight",
296 NUMPAD_PAREN_RIGHT
), // Keypad_)
298 //USB_KEYMAP(0x0700b8, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_BRACE_LEFT),
299 //USB_KEYMAP(0x0700b9, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_BRACE_RIGHT),
300 //USB_KEYMAP(0x0700ba, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_TAB),
301 USB_KEYMAP(0x0700bb, 0x0000, 0x0000, 0xffff, "NumpadBackspace",
302 NUMPAD_BACKSPACE
), // Keypad_Backspace
303 //USB_KEYMAP(0x0700bc, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_A),
304 //USB_KEYMAP(0x0700bd, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_B),
305 //USB_KEYMAP(0x0700be, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_C),
306 //USB_KEYMAP(0x0700bf, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_D),
308 //USB_KEYMAP(0x0700c0, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_E),
309 //USB_KEYMAP(0x0700c1, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_F),
310 //USB_KEYMAP(0x0700c2, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_XOR),
311 //USB_KEYMAP(0x0700c3, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_CARAT),
312 //USB_KEYMAP(0x0700c4, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_PERCENT),
313 //USB_KEYMAP(0x0700c5, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_LESS_THAN),
314 //USB_KEYMAP(0x0700c6, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_GREATER_THAN),
315 //USB_KEYMAP(0x0700c7, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_AMERSAND),
317 //USB_KEYMAP(0x0700c8, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_DOUBLE_AMPERSAND),
318 //USB_KEYMAP(0x0700c9, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_VERTICAL_BAR),
319 //USB_KEYMAP(0x0700ca, 0x0000, 0x0000, 0xffff, NULL,
320 // NUMPAD_DOUBLE_VERTICAL_BAR), // Keypad_||
321 //USB_KEYMAP(0x0700cb, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_COLON),
322 //USB_KEYMAP(0x0700cc, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_NUMBER),
323 //USB_KEYMAP(0x0700cd, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_SPACE),
324 //USB_KEYMAP(0x0700ce, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_AT),
325 //USB_KEYMAP(0x0700cf, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_EXCLAMATION),
327 USB_KEYMAP(0x0700d0, 0x0000, 0x0000, 0xffff, "NumpadMemoryStore",
328 NUMPAD_MEMORY_STORE
), // Keypad_MemoryStore
329 USB_KEYMAP(0x0700d1, 0x0000, 0x0000, 0xffff, "NumpadMemoryRecall",
330 NUMPAD_MEMORY_RECALL
), // Keypad_MemoryRecall
331 USB_KEYMAP(0x0700d2, 0x0000, 0x0000, 0xffff, "NumpadMemoryClear",
332 NUMPAD_MEMORY_CLEAR
), // Keypad_MemoryClear
333 USB_KEYMAP(0x0700d3, 0x0000, 0x0000, 0xffff, "NumpadMemoryAdd",
334 NUMPAD_MEMORY_ADD
), // Keypad_MemoryAdd
335 USB_KEYMAP(0x0700d4, 0x0000, 0x0000, 0xffff, "NumpadMemorySubtract",
336 NUMPAD_MEMORY_SUBTRACT
), // Keypad_MemorySubtract
337 //USB_KEYMAP(0x0700d5, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_MEMORY_MULTIPLE),
338 //USB_KEYMAP(0x0700d6, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_MEMORY_DIVIDE),
339 USB_KEYMAP(0x0700d7, 0x007e, 0x0000, 0xffff, NULL
, NUMPAD_SIGN_CHANGE
), // +/-
341 USB_KEYMAP(0x0700d8, 0x0000, 0x0000, 0xffff, "NumpadClear", NUMPAD_CLEAR
),
342 USB_KEYMAP(0x0700d9, 0x0000, 0x0000, 0xffff, "NumpadClearEntry",
343 NUMPAD_CLEAR_ENTRY
), // Keypad_ClearEntry
344 //USB_KEYMAP(0x0700da, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_BINARY),
345 //USB_KEYMAP(0x0700db, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_OCTAL),
346 //USB_KEYMAP(0x0700dc, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_DECIMAL),
347 //USB_KEYMAP(0x0700dd, 0x0000, 0x0000, 0xffff, NULL, NUMPAD_HEXADECIMAL),
348 // USB#0700de - #0700df are reserved.
350 USB_KEYMAP(0x0700e0, 0x0025, 0x001d, 0x003b, "ControlLeft", CONTROL_LEFT
),
351 USB_KEYMAP(0x0700e1, 0x0032, 0x002a, 0x0038, "ShiftLeft", SHIFT_LEFT
),
352 // USB#0700e2: left Alt key (Mac left Option key).
353 USB_KEYMAP(0x0700e2, 0x0040, 0x0038, 0x003a, "AltLeft", ALT_LEFT
),
354 // USB#0700e3: left GUI key, e.g. Windows, Mac Command, ChromeOS Search.
355 USB_KEYMAP(0x0700e3, 0x0085, 0xe05b, 0x0037, "OSLeft", OS_LEFT
),
356 USB_KEYMAP(0x0700e4, 0x0069, 0xe01d, 0x003e, "ControlRight", CONTROL_RIGHT
),
357 USB_KEYMAP(0x0700e5, 0x003e, 0x0036, 0x003c, "ShiftRight", SHIFT_RIGHT
),
358 // USB#0700e6: right Alt key (Mac right Option key).
359 USB_KEYMAP(0x0700e6, 0x006c, 0xe038, 0x003d, "AltRight", ALT_RIGHT
),
360 // USB#0700e7: right GUI key, e.g. Windows, Mac Command, ChromeOS Search.
361 USB_KEYMAP(0x0700e7, 0x0086, 0xe05c, 0x0036, "OSRight", OS_RIGHT
),
363 // USB#0700e8 - #07ffff are reserved
365 // ==================================
366 // USB Usage Page 0x0c: Consumer Page
367 // ==================================
368 // AL = Application Launch
369 // AC = Application Control
371 // TODO(garykac): Many XF86 keys have multiple scancodes mapping to them.
372 // We need to map all of these into a canonical USB scancode without
373 // confusing the reverse-lookup - most likely by simply returning the first
376 // TODO(garykac): Find appropriate mappings for:
377 // Win#e06b LaunchApp1 (My Computer?)
378 // Win#e021 LaunchApp2 (Calculator?)
379 // Win#e03c Music - USB#0c0193 is AL_AVCapturePlayback
380 // Win#e06d Video - USB#0c0193 is AL_AVCapturePlayback
382 // XKB#0080 XF86LaunchA
383 // XKB#0097 XF86WakeUp
386 // XKB#009c XF86Launch1
387 // XKB#009d XF86Launch2
388 // XKB... remaining XF86 keys
390 // KEY_BRIGHTNESS* added in Linux 3.16
391 // http://www.usb.org/developers/hidpage/HUTRR41.pdf
393 USB_KEYMAP(0x0c006f, 0x00e9, 0x0000, 0xffff, "BrightnessUp", BRIGHTNESS_UP
),
394 USB_KEYMAP(0x0c0070, 0x00ea, 0x0000, 0xffff, "BrightnessDown",
395 BRIGHTNESS_DOWN
), // Display Brightness Decrement
396 USB_KEYMAP(0x0c0072, 0x01b7, 0x0000, 0xffff, NULL
, BRIGHTNESS_TOGGLE
),
397 USB_KEYMAP(0x0c0073, 0x0258, 0x0000, 0xffff, NULL
, BRIGHTNESS_MINIMIUM
),
398 USB_KEYMAP(0x0c0074, 0x0259, 0x0000, 0xffff, NULL
, BRIGHTNESS_MAXIMUM
),
399 USB_KEYMAP(0x0c0075, 0x00fc, 0x0000, 0xffff, NULL
, BRIGHTNESS_AUTO
),
402 USB_KEYMAP(0x0c00b5, 0x0000, 0xe019, 0xffff, "MediaTrackNext",
404 USB_KEYMAP(0x0c00b6, 0x0000, 0xe010, 0xffff, "MediaTrackPrevious",
405 MEDIA_TRACK_PREVIOUS
),
406 USB_KEYMAP(0x0c00b7, 0x0000, 0xe024, 0xffff, "MediaStop", MEDIA_STOP
),
407 USB_KEYMAP(0x0c00b8, 0x0000, 0xe02c, 0xffff, "Eject", EJECT
),
408 USB_KEYMAP(0x0c00cd, 0x0000, 0xe022, 0xffff, "MediaPlayPause",
410 USB_KEYMAP(0x0c00cf, 0x024e, 0x0000, 0xffff, NULL
, VOICE_COMMAND
),
411 // USB#0c0183: AL Consumer Control Configuration
412 USB_KEYMAP(0x0c0183, 0x0000, 0x0000, 0xffff, "MediaSelect", MEDIA_SELECT
),
413 // USB#0x0c018a AL_EmailReader
414 USB_KEYMAP(0x0c018a, 0x0000, 0xe01e, 0xffff, "LaunchMail", LAUNCH_MAIL
),
415 // USB#0x0c018d: AL Contacts/Address Book
416 //USB_KEYMAP(0x0c018d, 0x01b5, 0x0000, 0xffff, NULL, LAUNCH_CONTACTS),
417 // USB#0x0c018e: AL Calendar/Schedule
418 //USB_KEYMAP(0x0c018e, 0x0195, 0x0000, 0xffff, NULL, LAUNCH_CALENDAR),
419 // USB#0x0c018f AL Task/Project Manager
420 //USB_KEYMAP(0x0c018f, 0x0249, 0x0000, 0xffff, NULL, LAUNCH_TASK_MANAGER),
421 // USB#0x0c0190: AL Log/Journal/Timecard
422 //USB_KEYMAP(0x0c0190, 0x024a, 0x0000, 0xffff, NULL, LAUNCH_LOG),
423 // USB#0x0c0192: AL_Calculator
424 USB_KEYMAP(0x0c0192, 0x0094, 0x0000, 0xffff, "LaunchApp2", LAUNCH_APP2
),
425 // USB#0c0194: My Computer (AL_LocalMachineBrowser)
426 USB_KEYMAP(0x0c0194, 0x00a5, 0x0000, 0xffff, "LaunchApp1", LAUNCH_APP1
),
427 //USB_KEYMAP(0x0c0196, 0x009e, 0x0000, 0xffff, NULL, LAUNCH_INTERNET_BROWSER),
428 // USB#0x0c019e: AL Terminal Lock/Screensaver
429 USB_KEYMAP(0x0c019e, 0x00a0, 0x0000, 0xffff, NULL
, LOCK_SCREEN
),
430 // USB#0x0c019f AL Control Panel
431 //USB_KEYMAP(0x0c019f, 0x024b, 0x0000, 0xffff, NULL, LAUNCH_CONTROL_PANEL),
432 // USB#0x0c01a2: AL Select Task/Application
433 USB_KEYMAP(0x0c01a2, 0x024c, 0x0000, 0xffff, "SelectTask", SELECT_TASK
),
434 // USB#0x0c01a7: AL_Documents
435 USB_KEYMAP(0x0c01a7, 0x00f3, 0x0000, 0xffff, NULL
, LAUNCH_DOCUMENTS
),
436 // USB#0x0c01ae: AL Keyboard Layout
437 USB_KEYMAP(0x0c01ae, 0x017e, 0x0000, 0xffff, NULL
, LAUNCH_KEYBOARD_LAYOUT
),
438 USB_KEYMAP(0x0c01b1, 0x024d, 0x0000, 0xffff, "LaunchScreenSaver",
439 LAUNCH_SCREEN_SAVER
), // AL Screen Saver
440 // USB#0c01b4: Home Directory (AL_FileBrowser) (Explorer)
441 USB_KEYMAP(0x0c01b4, 0x0098, 0x0000, 0xffff, NULL
, LAUNCH_FILE_BROWSER
),
442 // USB#0x0c01b7: AL Audio Browser
443 //USB_KEYMAP(0x0c01b7, 0x0190, 0x0000, 0xffff, NULL, LAUNCH_AUDIO_BROWSER),
444 // USB#0x0c0221: AC_Search
445 USB_KEYMAP(0x0c0221, 0x0000, 0xe065, 0xffff, "BrowserSearch", BROWSER_SEARCH
),
446 // USB#0x0c0223: AC_Home
447 USB_KEYMAP(0x0c0223, 0x0000, 0xe032, 0xffff, "BrowserHome", BROWSER_HOME
),
448 // USB#0x0c0224: AC_Back
449 USB_KEYMAP(0x0c0224, 0x00a6, 0xe06a, 0xffff, "BrowserBack", BROWSER_BACK
),
450 // USB#0x0c0225: AC_Forward
451 USB_KEYMAP(0x0c0225, 0x00a7, 0xe069, 0xffff, "BrowserForward",
453 // USB#0x0c0226: AC_Stop
454 USB_KEYMAP(0x0c0226, 0x0000, 0xe068, 0xffff, "BrowserStop", BROWSER_STOP
),
455 // USB#0x0c0227: AC_Refresh (Reload)
456 USB_KEYMAP(0x0c0227, 0x00b5, 0xe067, 0xffff, "BrowserRefresh",
458 // USB#0x0c022a: AC_Bookmarks (Favorites)
459 USB_KEYMAP(0x0c022a, 0x00a4, 0xe066, 0xffff, "BrowserFavorites",
461 // USB#0x0c0230: AC Full Screen View
462 //USB_KEYMAP(0x0c0230, 0x0000, 0x0000, 0xffff, NULL, ZOOM_FULL),
463 // USB#0x0c0231: AC Normal View
464 //USB_KEYMAP(0x0c0231, 0x0000, 0x0000, 0xffff, NULL, ZOOM_NORMAL),
465 // USB#0x0c0232: AC View Toggle
466 USB_KEYMAP(0x0c0232, 0x0000, 0x0000, 0xffff, "ZoomToggle", ZOOM_TOGGLE
),
467 // USB#0x0c0289: AC_Reply
468 USB_KEYMAP(0x0c0289, 0x00f0, 0x0000, 0xffff, "MailReply", MAIL_REPLY
),
469 // USB#0x0c028b: AC_ForwardMsg (MailForward)
470 USB_KEYMAP(0x0c028b, 0x00f1, 0x0000, 0xffff, "MailForward", MAIL_FORWARD
),
471 // USB#0x0c028c: AC_Send
472 USB_KEYMAP(0x0c028c, 0x00ef, 0x0000, 0xffff, "MailSend", MAIL_SEND
),