Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
5
* You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
/**
8
* This header file defines simple key mapping between native keycode value and
9
* DOM key name index.
10
* You must define NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX macro before include
11
* this.
12
*
13
* It must have two arguments, (aNativeKey, aKeyNameIndex).
14
* aNativeKey is a native keycode value.
15
* aKeyNameIndex is the widget::KeyNameIndex value.
16
*/
17
18
// Windows
19
#define KEY_MAP_WIN(aCPPKeyName, aNativeKey)
20
#define KEY_MAP_WIN_JPN(aCPPKeyName, aNativeKey)
21
#define KEY_MAP_WIN_KOR(aCPPKeyName, aNativeKey)
22
#define KEY_MAP_WIN_OTH(aCPPKeyName, aNativeKey)
23
#define KEY_MAP_WIN_CMD(aCPPKeyName, aAppCommand)
24
// Mac OS X
25
#define KEY_MAP_COCOA(aCPPKeyName, aNativeKey)
26
// GTK
27
#define KEY_MAP_GTK(aCPPKeyName, aNativeKey)
28
// Only for Android
29
#define KEY_MAP_ANDROID(aCPPKeyName, aNativeKey)
30
31
#if defined(XP_WIN)
32
# if defined(NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX)
33
// KEY_MAP_WIN() defines the mapping not depending on keyboard layout.
34
# undef KEY_MAP_WIN
35
# define KEY_MAP_WIN(aCPPKeyName, aNativeKey) \
36
NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, \
37
KEY_NAME_INDEX_##aCPPKeyName)
38
# elif defined(NS_JAPANESE_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX)
39
// KEY_MAP_WIN_JPN() defines the mapping which is valid only with Japanese
40
// keyboard layout.
41
# undef KEY_MAP_WIN_JPN
42
# define KEY_MAP_WIN_JPN(aCPPKeyName, aNativeKey) \
43
NS_JAPANESE_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX( \
44
aNativeKey, KEY_NAME_INDEX_##aCPPKeyName)
45
# elif defined(NS_KOREAN_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX)
46
// KEY_MAP_WIN_KOR() defines the mapping which is valid only with Korean
47
// keyboard layout.
48
# undef KEY_MAP_WIN_KOR
49
# define KEY_MAP_WIN_KOR(aCPPKeyName, aNativeKey) \
50
NS_KOREAN_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, \
51
KEY_NAME_INDEX_##aCPPKeyName)
52
# elif defined(NS_OTHER_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX)
53
// KEY_MAP_WIN_OTH() defines the mapping which is valid with neither
54
// Japanese keyboard layout nor Korean keyboard layout.
55
# undef KEY_MAP_WIN_OTH
56
# define KEY_MAP_WIN_OTH(aCPPKeyName, aNativeKey) \
57
NS_OTHER_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, \
58
KEY_NAME_INDEX_##aCPPKeyName)
59
# elif defined(NS_APPCOMMAND_TO_DOM_KEY_NAME_INDEX)
60
// KEY_MAP_WIN_CMD() defines the mapping from APPCOMMAND_* of WM_APPCOMMAND.
61
# undef KEY_MAP_WIN_CMD
62
# define KEY_MAP_WIN_CMD(aCPPKeyName, aAppCommand) \
63
NS_APPCOMMAND_TO_DOM_KEY_NAME_INDEX(aAppCommand, \
64
KEY_NAME_INDEX_##aCPPKeyName)
65
# else
66
# error Any NS_*_TO_DOM_KEY_NAME_INDEX() is not defined.
67
# endif // #if defined(NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX) ...
68
#elif defined(XP_MACOSX)
69
# undef KEY_MAP_COCOA
70
# define KEY_MAP_COCOA(aCPPKeyName, aNativeKey) \
71
NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, \
72
KEY_NAME_INDEX_##aCPPKeyName)
73
#elif defined(MOZ_WIDGET_GTK)
74
# undef KEY_MAP_GTK
75
# define KEY_MAP_GTK(aCPPKeyName, aNativeKey) \
76
NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, \
77
KEY_NAME_INDEX_##aCPPKeyName)
78
#elif defined(ANDROID)
79
# undef KEY_MAP_ANDROID
80
# define KEY_MAP_ANDROID(aCPPKeyName, aNativeKey) \
81
NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, \
82
KEY_NAME_INDEX_##aCPPKeyName)
83
#endif
84
85
/******************************************************************************
86
* Modifier Keys
87
******************************************************************************/
88
// Alt
89
KEY_MAP_WIN(Alt, VK_MENU)
90
KEY_MAP_WIN(Alt, VK_LMENU)
91
KEY_MAP_WIN(Alt, VK_RMENU) // This is ignored if active keyboard layout
92
// has AltGr. In such case, AltGraph is mapped.
93
KEY_MAP_COCOA(Alt, kVK_Option)
94
KEY_MAP_COCOA(Alt, kVK_RightOption)
95
KEY_MAP_GTK(Alt, GDK_Alt_L)
96
KEY_MAP_GTK(Alt, GDK_Alt_R)
97
KEY_MAP_ANDROID(Alt, AKEYCODE_ALT_LEFT)
98
KEY_MAP_ANDROID(Alt, AKEYCODE_ALT_RIGHT)
99
100
// AltGraph
101
KEY_MAP_GTK (AltGraph, GDK_Mode_switch /* same as GDK_kana_switch,
102
GDK_ISO_Group_Shift and
103
GDK_script_switch */)
104
// Let's treat both Level 3 shift and Level 5 shift as AltGr.
105
// And also, let's treat Latch key and Lock key as AltGr key too like
106
// GDK_Shift_Lock.
107
KEY_MAP_GTK(AltGraph, GDK_ISO_Level3_Shift)
108
KEY_MAP_GTK(AltGraph, GDK_ISO_Level3_Latch)
109
KEY_MAP_GTK(AltGraph, GDK_ISO_Level3_Lock)
110
KEY_MAP_GTK(AltGraph, GDK_ISO_Level5_Shift)
111
KEY_MAP_GTK(AltGraph, GDK_ISO_Level5_Latch)
112
KEY_MAP_GTK(AltGraph, GDK_ISO_Level5_Lock)
113
114
// CapsLock
115
KEY_MAP_WIN(CapsLock, VK_CAPITAL)
116
KEY_MAP_COCOA(CapsLock, kVK_CapsLock)
117
KEY_MAP_GTK(CapsLock, GDK_Caps_Lock)
118
KEY_MAP_ANDROID(CapsLock, AKEYCODE_CAPS_LOCK)
119
120
// Control
121
KEY_MAP_WIN(Control, VK_CONTROL)
122
KEY_MAP_WIN(Control, VK_LCONTROL)
123
KEY_MAP_WIN(Control, VK_RCONTROL)
124
KEY_MAP_COCOA(Control, kVK_Control)
125
KEY_MAP_COCOA(Control, kVK_RightControl)
126
KEY_MAP_GTK(Control, GDK_Control_L)
127
KEY_MAP_GTK(Control, GDK_Control_R)
128
KEY_MAP_ANDROID(Control, AKEYCODE_CTRL_LEFT)
129
KEY_MAP_ANDROID(Control, AKEYCODE_CTRL_RIGHT)
130
131
// Fn
132
KEY_MAP_COCOA(Fn, kVK_Function)
133
KEY_MAP_ANDROID(Fn, AKEYCODE_FUNCTION)
134
135
// Meta
136
KEY_MAP_COCOA(Meta, kVK_Command)
137
KEY_MAP_COCOA(Meta, kVK_RightCommand)
138
KEY_MAP_GTK(Meta, GDK_Meta_L)
139
KEY_MAP_GTK(Meta, GDK_Meta_R)
140
KEY_MAP_ANDROID(Meta, AKEYCODE_META_LEFT)
141
KEY_MAP_ANDROID(Meta, AKEYCODE_META_RIGHT)
142
143
// NumLock
144
KEY_MAP_WIN(NumLock, VK_NUMLOCK)
145
KEY_MAP_GTK(NumLock, GDK_Num_Lock)
146
KEY_MAP_ANDROID(NumLock, AKEYCODE_NUM_LOCK)
147
148
// OS
149
KEY_MAP_WIN(OS, VK_LWIN)
150
KEY_MAP_WIN(OS, VK_RWIN)
151
KEY_MAP_GTK(OS, GDK_Super_L)
152
KEY_MAP_GTK(OS, GDK_Super_R)
153
KEY_MAP_GTK(OS, GDK_Hyper_L)
154
KEY_MAP_GTK(OS, GDK_Hyper_R)
155
156
// ScrollLock
157
KEY_MAP_WIN(ScrollLock, VK_SCROLL)
158
KEY_MAP_GTK(ScrollLock, GDK_Scroll_Lock)
159
KEY_MAP_ANDROID(ScrollLock, AKEYCODE_SCROLL_LOCK)
160
161
// Shift
162
KEY_MAP_WIN(Shift, VK_SHIFT)
163
KEY_MAP_WIN(Shift, VK_LSHIFT)
164
KEY_MAP_WIN(Shift, VK_RSHIFT)
165
KEY_MAP_COCOA(Shift, kVK_Shift)
166
KEY_MAP_COCOA(Shift, kVK_RightShift)
167
KEY_MAP_GTK(Shift, GDK_Shift_L)
168
KEY_MAP_GTK(Shift, GDK_Shift_R)
169
KEY_MAP_GTK(Shift, GDK_Shift_Lock) // Let's treat as Shift key (bug 769159)
170
KEY_MAP_ANDROID(Shift, AKEYCODE_SHIFT_LEFT)
171
KEY_MAP_ANDROID(Shift, AKEYCODE_SHIFT_RIGHT)
172
173
// Symbol
174
KEY_MAP_ANDROID(Symbol, AKEYCODE_SYM)
175
176
/******************************************************************************
177
* Whitespace Keys
178
******************************************************************************/
179
// Enter
180
KEY_MAP_WIN(Enter, VK_RETURN)
181
KEY_MAP_COCOA(Enter, kVK_Return)
182
KEY_MAP_COCOA(Enter, kVK_ANSI_KeypadEnter)
183
KEY_MAP_COCOA(Enter, kVK_Powerbook_KeypadEnter)
184
KEY_MAP_GTK(Enter, GDK_Return)
185
KEY_MAP_GTK(Enter, GDK_KP_Enter)
186
KEY_MAP_GTK(Enter, GDK_ISO_Enter)
187
KEY_MAP_GTK(Enter, GDK_3270_Enter)
188
KEY_MAP_ANDROID(Enter, AKEYCODE_DPAD_CENTER)
189
KEY_MAP_ANDROID(Enter, AKEYCODE_ENTER)
190
KEY_MAP_ANDROID(Enter, AKEYCODE_NUMPAD_ENTER)
191
192
// Tab
193
KEY_MAP_WIN(Tab, VK_TAB)
194
KEY_MAP_COCOA(Tab, kVK_Tab)
195
KEY_MAP_GTK(Tab, GDK_Tab)
196
KEY_MAP_GTK(Tab, GDK_ISO_Left_Tab) // Shift+Tab
197
KEY_MAP_GTK(Tab, GDK_KP_Tab)
198
KEY_MAP_ANDROID(Tab, AKEYCODE_TAB)
199
200
/******************************************************************************
201
* Navigation Keys
202
******************************************************************************/
203
// ArrowDown
204
KEY_MAP_WIN(ArrowDown, VK_DOWN)
205
KEY_MAP_COCOA(ArrowDown, kVK_DownArrow)
206
KEY_MAP_GTK(ArrowDown, GDK_Down)
207
KEY_MAP_GTK(ArrowDown, GDK_KP_Down)
208
KEY_MAP_ANDROID(ArrowDown, AKEYCODE_DPAD_DOWN)
209
210
// ArrowLeft
211
KEY_MAP_WIN(ArrowLeft, VK_LEFT)
212
KEY_MAP_COCOA(ArrowLeft, kVK_LeftArrow)
213
KEY_MAP_GTK(ArrowLeft, GDK_Left)
214
KEY_MAP_GTK(ArrowLeft, GDK_KP_Left)
215
KEY_MAP_ANDROID(ArrowLeft, AKEYCODE_DPAD_LEFT)
216
217
// ArrowRight
218
KEY_MAP_WIN(ArrowRight, VK_RIGHT)
219
KEY_MAP_COCOA(ArrowRight, kVK_RightArrow)
220
KEY_MAP_GTK(ArrowRight, GDK_Right)
221
KEY_MAP_GTK(ArrowRight, GDK_KP_Right)
222
KEY_MAP_ANDROID(ArrowRight, AKEYCODE_DPAD_RIGHT)
223
224
// ArrowUp
225
KEY_MAP_WIN(ArrowUp, VK_UP)
226
KEY_MAP_COCOA(ArrowUp, kVK_UpArrow)
227
KEY_MAP_GTK(ArrowUp, GDK_Up)
228
KEY_MAP_GTK(ArrowUp, GDK_KP_Up)
229
KEY_MAP_ANDROID(ArrowUp, AKEYCODE_DPAD_UP)
230
231
// End
232
KEY_MAP_WIN(End, VK_END)
233
KEY_MAP_COCOA(End, kVK_End)
234
KEY_MAP_GTK(End, GDK_End)
235
KEY_MAP_GTK(End, GDK_KP_End)
236
KEY_MAP_ANDROID(End, AKEYCODE_MOVE_END)
237
238
// Home
239
KEY_MAP_WIN(Home, VK_HOME)
240
KEY_MAP_COCOA(Home, kVK_Home)
241
KEY_MAP_GTK(Home, GDK_Home)
242
KEY_MAP_GTK(Home, GDK_KP_Home)
243
KEY_MAP_ANDROID(Home, AKEYCODE_MOVE_HOME)
244
245
// PageDown
246
KEY_MAP_WIN(PageDown, VK_NEXT)
247
KEY_MAP_COCOA(PageDown, kVK_PageDown)
248
KEY_MAP_GTK(PageDown, GDK_Page_Down /* same as GDK_Next */)
249
KEY_MAP_GTK(PageDown, GDK_KP_Page_Down /* same as GDK_KP_Next */)
250
KEY_MAP_ANDROID(PageDown, AKEYCODE_PAGE_DOWN)
251
252
// PageUp
253
KEY_MAP_WIN(PageUp, VK_PRIOR)
254
KEY_MAP_COCOA(PageUp, kVK_PageUp)
255
KEY_MAP_GTK(PageUp, GDK_Page_Up /* same as GDK_Prior */)
256
KEY_MAP_GTK(PageUp, GDK_KP_Page_Up /* same as GDK_KP_Prior */)
257
KEY_MAP_ANDROID(PageUp, AKEYCODE_PAGE_UP)
258
259
/******************************************************************************
260
* Editing Keys
261
******************************************************************************/
262
// Backspace
263
KEY_MAP_WIN(Backspace, VK_BACK)
264
KEY_MAP_COCOA(Backspace, kVK_PC_Backspace)
265
KEY_MAP_GTK(Backspace, GDK_BackSpace)
266
KEY_MAP_ANDROID(Backspace, AKEYCODE_DEL)
267
268
// Clear
269
KEY_MAP_WIN(Clear, VK_CLEAR)
270
KEY_MAP_WIN(Clear, VK_OEM_CLEAR)
271
KEY_MAP_COCOA(Clear, kVK_ANSI_KeypadClear)
272
KEY_MAP_GTK(Clear, GDK_Clear)
273
KEY_MAP_ANDROID(Clear, AKEYCODE_CLEAR)
274
275
// Copy
276
KEY_MAP_WIN_CMD(Copy, APPCOMMAND_COPY)
277
KEY_MAP_GTK(Copy, GDK_Copy)
278
KEY_MAP_ANDROID(Copy, AKEYCODE_COPY)
279
280
// CrSel
281
KEY_MAP_WIN(CrSel, VK_CRSEL)
282
KEY_MAP_GTK(CrSel, GDK_3270_CursorSelect) // legacy IBM keyboard layout
283
284
// Cut
285
KEY_MAP_WIN_CMD(Cut, APPCOMMAND_CUT)
286
KEY_MAP_GTK(Cut, GDK_Cut)
287
KEY_MAP_ANDROID(Cut, AKEYCODE_CUT)
288
289
// Delete
290
KEY_MAP_WIN(Delete, VK_DELETE)
291
KEY_MAP_COCOA(Delete, kVK_PC_Delete)
292
KEY_MAP_GTK(Delete, GDK_Delete)
293
KEY_MAP_GTK(Delete, GDK_KP_Delete)
294
KEY_MAP_ANDROID(Delete, AKEYCODE_FORWARD_DEL)
295
296
// EraseEof
297
KEY_MAP_WIN(EraseEof, VK_EREOF)
298
KEY_MAP_GTK(EraseEof, GDK_3270_EraseEOF) // legacy IBM keyboard layout
299
300
// ExSel
301
KEY_MAP_WIN(ExSel, VK_EXSEL)
302
KEY_MAP_GTK(ExSel, GDK_3270_ExSelect) // legacy IBM keyboard layout
303
304
// Insert
305
KEY_MAP_WIN(Insert, VK_INSERT)
306
KEY_MAP_GTK(Insert, GDK_Insert)
307
KEY_MAP_GTK(Insert, GDK_KP_Insert)
308
KEY_MAP_ANDROID(Insert, AKEYCODE_INSERT)
309
310
// Paste
311
KEY_MAP_WIN_CMD(Paste, APPCOMMAND_PASTE)
312
KEY_MAP_GTK(Paste, GDK_Paste)
313
KEY_MAP_ANDROID(Paste, AKEYCODE_PASTE)
314
315
// Redo
316
KEY_MAP_WIN_CMD(Redo, APPCOMMAND_REDO)
317
KEY_MAP_GTK(Redo, GDK_Redo)
318
319
// Undo
320
KEY_MAP_WIN_CMD(Undo, APPCOMMAND_UNDO)
321
KEY_MAP_GTK(Undo, GDK_Undo)
322
323
/******************************************************************************
324
* UI Keys
325
******************************************************************************/
326
// Accept
327
KEY_MAP_WIN(Accept, VK_ACCEPT)
328
329
// Attn
330
KEY_MAP_WIN_OTH(Attn, VK_ATTN) // not valid with Japanese keyboard layout
331
KEY_MAP_GTK(Attn, GDK_3270_Attn) // legacy IBM keyboard layout
332
333
// Cancel
334
KEY_MAP_WIN(Cancel, VK_CANCEL)
335
KEY_MAP_GTK(Cancel, GDK_Cancel)
336
337
// ContextMenu
338
KEY_MAP_WIN(ContextMenu, VK_APPS)
339
KEY_MAP_COCOA(ContextMenu, kVK_PC_ContextMenu)
340
KEY_MAP_GTK(ContextMenu, GDK_Menu)
341
KEY_MAP_ANDROID(ContextMenu, AKEYCODE_MENU)
342
343
// Escape
344
KEY_MAP_WIN(Escape, VK_ESCAPE)
345
KEY_MAP_COCOA(Escape, kVK_Escape)
346
KEY_MAP_GTK(Escape, GDK_Escape)
347
KEY_MAP_ANDROID(Escape, AKEYCODE_ESCAPE)
348
349
// Execute
350
KEY_MAP_WIN(Execute, VK_EXECUTE)
351
KEY_MAP_GTK(Execute, GDK_Execute)
352
353
// Find
354
KEY_MAP_WIN_CMD(Find, APPCOMMAND_FIND)
355
KEY_MAP_GTK(Find, GDK_Find)
356
357
// Help
358
KEY_MAP_WIN(Help, VK_HELP)
359
KEY_MAP_WIN_CMD(Help, APPCOMMAND_HELP)
360
KEY_MAP_COCOA(Help, kVK_Help)
361
KEY_MAP_GTK(Help, GDK_Help)
362
KEY_MAP_ANDROID(Help, AKEYCODE_HELP)
363
364
// Pause
365
KEY_MAP_WIN(Pause, VK_PAUSE)
366
KEY_MAP_GTK(Pause, GDK_Pause)
367
// Break is typically mapped to Alt+Pause or Ctrl+Pause on GTK.
368
KEY_MAP_GTK(Pause, GDK_Break)
369
KEY_MAP_ANDROID(Pause, AKEYCODE_BREAK)
370
371
// Play
372
KEY_MAP_WIN(Play, VK_PLAY)
373
KEY_MAP_GTK(Play, GDK_3270_Play) // legacy IBM keyboard layout
374
375
// Select
376
KEY_MAP_WIN(Select, VK_SELECT)
377
KEY_MAP_GTK(Select, GDK_Select)
378
379
// ZoomIn
380
KEY_MAP_GTK(ZoomIn, GDK_ZoomIn)
381
KEY_MAP_ANDROID(ZoomIn, AKEYCODE_ZOOM_IN)
382
383
// ZoomOut
384
KEY_MAP_GTK(ZoomOut, GDK_ZoomOut)
385
KEY_MAP_ANDROID(ZoomOut, AKEYCODE_ZOOM_OUT)
386
387
/******************************************************************************
388
* Device Keys
389
******************************************************************************/
390
// BrightnessDown
391
KEY_MAP_GTK(BrightnessDown, GDK_MonBrightnessDown)
392
KEY_MAP_ANDROID(BrightnessDown, AKEYCODE_BRIGHTNESS_DOWN)
393
394
// BrightnessUp
395
KEY_MAP_GTK(BrightnessUp, GDK_MonBrightnessUp)
396
KEY_MAP_ANDROID(BrightnessUp, AKEYCODE_BRIGHTNESS_UP)
397
398
// Eject
399
KEY_MAP_GTK(Eject, GDK_Eject)
400
KEY_MAP_ANDROID(Eject, AKEYCODE_MEDIA_EJECT)
401
402
// LogOff
403
KEY_MAP_GTK(LogOff, GDK_LogOff)
404
405
// Power
406
KEY_MAP_ANDROID(Power, AKEYCODE_POWER)
407
408
// PowerOff
409
KEY_MAP_GTK(PowerOff, GDK_PowerDown)
410
KEY_MAP_GTK(PowerOff, GDK_PowerOff)
411
412
// PrintScreen
413
KEY_MAP_WIN(PrintScreen, VK_SNAPSHOT)
414
KEY_MAP_GTK(PrintScreen, GDK_3270_PrintScreen)
415
KEY_MAP_GTK(PrintScreen, GDK_Print)
416
KEY_MAP_GTK(PrintScreen, GDK_Sys_Req)
417
KEY_MAP_ANDROID(PrintScreen, AKEYCODE_SYSRQ)
418
419
// Hibernate
420
KEY_MAP_GTK(Hibernate, GDK_Hibernate)
421
422
// Standby
423
KEY_MAP_WIN(Standby, VK_SLEEP)
424
KEY_MAP_GTK(Standby, GDK_Standby)
425
KEY_MAP_GTK(Standby, GDK_Suspend)
426
KEY_MAP_GTK(Standby, GDK_Sleep)
427
KEY_MAP_ANDROID(Standby, AKEYCODE_SLEEP)
428
429
// WakeUp
430
KEY_MAP_GTK(WakeUp, GDK_WakeUp)
431
KEY_MAP_ANDROID(WakeUp, AKEYCODE_WAKEUP)
432
433
/******************************************************************************
434
* IME and Composition Keys
435
******************************************************************************/
436
// AllCandidates
437
KEY_MAP_GTK(AllCandidates, GDK_MultipleCandidate) // OADG 109, Zen Koho
438
439
// Alphanumeric
440
KEY_MAP_WIN_JPN(Alphanumeric, VK_OEM_ATTN)
441
KEY_MAP_GTK(Alphanumeric, GDK_Eisu_Shift)
442
KEY_MAP_GTK(Alphanumeric, GDK_Eisu_toggle)
443
444
// CodeInput
445
KEY_MAP_GTK(CodeInput, GDK_Codeinput) // OADG 109, Kanji Bangou
446
447
// Compose
448
KEY_MAP_GTK(Compose, GDK_Multi_key) // "Multi Key" is "Compose key" on X
449
450
// Convert
451
KEY_MAP_WIN(Convert, VK_CONVERT)
452
KEY_MAP_GTK(Convert, GDK_Henkan)
453
KEY_MAP_ANDROID(Convert, AKEYCODE_HENKAN)
454
455
// Dead
456
KEY_MAP_GTK(Dead, GDK_dead_grave)
457
KEY_MAP_GTK(Dead, GDK_dead_acute)
458
KEY_MAP_GTK(Dead, GDK_dead_circumflex)
459
KEY_MAP_GTK(Dead, GDK_dead_tilde) // Same as GDK_dead_perispomeni
460
KEY_MAP_GTK(Dead, GDK_dead_macron)
461
KEY_MAP_GTK(Dead, GDK_dead_breve)
462
KEY_MAP_GTK(Dead, GDK_dead_abovedot)
463
KEY_MAP_GTK(Dead, GDK_dead_diaeresis)
464
KEY_MAP_GTK(Dead, GDK_dead_abovering)
465
KEY_MAP_GTK(Dead, GDK_dead_doubleacute)
466
KEY_MAP_GTK(Dead, GDK_dead_caron)
467
KEY_MAP_GTK(Dead, GDK_dead_cedilla)
468
KEY_MAP_GTK(Dead, GDK_dead_ogonek)
469
KEY_MAP_GTK(Dead, GDK_dead_iota)
470
KEY_MAP_GTK(Dead, GDK_dead_voiced_sound)
471
KEY_MAP_GTK(Dead, GDK_dead_semivoiced_sound)
472
KEY_MAP_GTK(Dead, GDK_dead_belowdot)
473
KEY_MAP_GTK(Dead, GDK_dead_hook)
474
KEY_MAP_GTK(Dead, GDK_dead_horn)
475
KEY_MAP_GTK(Dead, GDK_dead_stroke)
476
KEY_MAP_GTK(Dead, GDK_dead_abovecomma) // Same as GDK_dead_psili
477
KEY_MAP_GTK(Dead, GDK_dead_abovereversedcomma) // Same as GDK_dead_dasia
478
KEY_MAP_GTK(Dead, GDK_dead_doublegrave)
479
KEY_MAP_GTK(Dead, GDK_dead_belowring)
480
KEY_MAP_GTK(Dead, GDK_dead_belowmacron)
481
KEY_MAP_GTK(Dead, GDK_dead_belowcircumflex)
482
KEY_MAP_GTK(Dead, GDK_dead_belowtilde)
483
KEY_MAP_GTK(Dead, GDK_dead_belowbreve)
484
KEY_MAP_GTK(Dead, GDK_dead_belowdiaeresis)
485
KEY_MAP_GTK(Dead, GDK_dead_invertedbreve)
486
KEY_MAP_GTK(Dead, GDK_dead_belowcomma)
487
KEY_MAP_GTK(Dead, GDK_dead_currency)
488
KEY_MAP_GTK(Dead, GDK_dead_a)
489
KEY_MAP_GTK(Dead, GDK_dead_A)
490
KEY_MAP_GTK(Dead, GDK_dead_e)
491
KEY_MAP_GTK(Dead, GDK_dead_E)
492
KEY_MAP_GTK(Dead, GDK_dead_i)
493
KEY_MAP_GTK(Dead, GDK_dead_I)
494
KEY_MAP_GTK(Dead, GDK_dead_o)
495
KEY_MAP_GTK(Dead, GDK_dead_O)
496
KEY_MAP_GTK(Dead, GDK_dead_u)
497
KEY_MAP_GTK(Dead, GDK_dead_U)
498
KEY_MAP_GTK(Dead, GDK_dead_small_schwa)
499
KEY_MAP_GTK(Dead, GDK_dead_capital_schwa)
500
KEY_MAP_GTK(Dead, GDK_dead_greek)
501
502
// FinalMode
503
KEY_MAP_WIN(FinalMode, VK_FINAL)
504
505
// GroupFirst
506
KEY_MAP_GTK(GroupFirst, GDK_ISO_First_Group)
507
508
// GroupLast
509
KEY_MAP_GTK(GroupLast, GDK_ISO_Last_Group)
510
511
// GroupNext
512
KEY_MAP_GTK(GroupNext, GDK_ISO_Next_Group)
513
KEY_MAP_ANDROID(GroupNext, AKEYCODE_LANGUAGE_SWITCH)
514
515
// GroupPrevious
516
KEY_MAP_GTK(GroupPrevious, GDK_ISO_Prev_Group)
517
518
// ModeChange
519
KEY_MAP_WIN(ModeChange, VK_MODECHANGE)
520
KEY_MAP_ANDROID(ModeChange, AKEYCODE_SWITCH_CHARSET)
521
522
// NonConvert
523
KEY_MAP_WIN(NonConvert, VK_NONCONVERT)
524
KEY_MAP_GTK(NonConvert, GDK_Muhenkan)
525
KEY_MAP_ANDROID(NonConvert, AKEYCODE_MUHENKAN)
526
527
// PreviousCandidate
528
KEY_MAP_GTK(PreviousCandidate, GDK_PreviousCandidate) // OADG 109, Mae Koho
529
530
// Process
531
KEY_MAP_WIN(Process, VK_PROCESSKEY)
532
533
// SingleCandidate
534
KEY_MAP_GTK(SingleCandidate, GDK_SingleCandidate)
535
536
/******************************************************************************
537
* Keys specific to Korean keyboards
538
******************************************************************************/
539
// HangulMode
540
KEY_MAP_WIN_KOR(HangulMode, VK_HANGUL /* same as VK_KANA */)
541
542
// HanjaMode
543
KEY_MAP_WIN_KOR(HanjaMode, VK_HANJA /* same as VK_KANJI */)
544
545
// JunjaMode
546
KEY_MAP_WIN(JunjaMode, VK_JUNJA)
547
548
/******************************************************************************
549
* Keys specific to Japanese keyboards
550
******************************************************************************/
551
// Eisu
552
KEY_MAP_COCOA(Eisu, kVK_JIS_Eisu)
553
KEY_MAP_ANDROID(Eisu, AKEYCODE_EISU)
554
555
// Hankaku
556
KEY_MAP_WIN_JPN(Hankaku, VK_OEM_AUTO)
557
KEY_MAP_GTK(Hankaku, GDK_Hankaku)
558
559
// Hiragana
560
KEY_MAP_WIN_JPN(Hiragana, VK_OEM_COPY)
561
KEY_MAP_GTK(Hiragana, GDK_Hiragana)
562
563
// HiraganaKatakana
564
KEY_MAP_GTK(HiraganaKatakana, GDK_Hiragana_Katakana)
565
KEY_MAP_ANDROID(HiraganaKatakana, AKEYCODE_KATAKANA_HIRAGANA)
566
567
// KanaMode
568
// VK_KANA is never used with modern Japanese keyboard, however, IE maps it to
569
// KanaMode, therefore, we should use same map for it.
570
KEY_MAP_WIN_JPN(KanaMode, VK_KANA /* same as VK_HANGUL */)
571
KEY_MAP_WIN_JPN(KanaMode, VK_ATTN)
572
KEY_MAP_GTK(KanaMode, GDK_Kana_Lock)
573
KEY_MAP_GTK(KanaMode, GDK_Kana_Shift)
574
575
// KanjiMode
576
KEY_MAP_WIN_JPN(KanjiMode, VK_KANJI /* same as VK_HANJA */)
577
KEY_MAP_COCOA(KanjiMode, kVK_JIS_Kana) // Kana key opens IME
578
KEY_MAP_GTK(KanjiMode, GDK_Kanji) // Typically, Alt + Hankaku/Zenkaku key
579
// Assuming that KANA key of Android is the Kana key on Mac keyboard.
580
KEY_MAP_ANDROID(KanjiMode, AKEYCODE_KANA)
581
582
// Katakana
583
KEY_MAP_WIN_JPN(Katakana, VK_OEM_FINISH)
584
KEY_MAP_GTK(Katakana, GDK_Katakana)
585
586
// Romaji
587
KEY_MAP_WIN_JPN(Romaji, VK_OEM_BACKTAB)
588
KEY_MAP_GTK(Romaji, GDK_Romaji)
589
590
// Zenkaku
591
KEY_MAP_WIN_JPN(Zenkaku, VK_OEM_ENLW)
592
KEY_MAP_GTK(Zenkaku, GDK_Zenkaku)
593
594
// ZenkakuHankaku
595
KEY_MAP_GTK(ZenkakuHankaku, GDK_Zenkaku_Hankaku)
596
KEY_MAP_ANDROID(ZenkakuHankaku, AKEYCODE_ZENKAKU_HANKAKU)
597
598
/******************************************************************************
599
* General-Purpose Function Keys
600
******************************************************************************/
601
// F1
602
KEY_MAP_WIN(F1, VK_F1)
603
KEY_MAP_COCOA(F1, kVK_F1)
604
KEY_MAP_GTK(F1, GDK_F1)
605
KEY_MAP_GTK(F1, GDK_KP_F1)
606
KEY_MAP_ANDROID(F1, AKEYCODE_F1)
607
608
// F2
609
KEY_MAP_WIN(F2, VK_F2)
610
KEY_MAP_COCOA(F2, kVK_F2)
611
KEY_MAP_GTK(F2, GDK_F2)
612
KEY_MAP_GTK(F2, GDK_KP_F2)
613
KEY_MAP_ANDROID(F2, AKEYCODE_F2)
614
615
// F3
616
KEY_MAP_WIN(F3, VK_F3)
617
KEY_MAP_COCOA(F3, kVK_F3)
618
KEY_MAP_GTK(F3, GDK_F3)
619
KEY_MAP_GTK(F3, GDK_KP_F3)
620
KEY_MAP_ANDROID(F3, AKEYCODE_F3)
621
622
// F4
623
KEY_MAP_WIN(F4, VK_F4)
624
KEY_MAP_COCOA(F4, kVK_F4)
625
KEY_MAP_GTK(F4, GDK_F4)
626
KEY_MAP_GTK(F4, GDK_KP_F4)
627
KEY_MAP_ANDROID(F4, AKEYCODE_F4)
628
629
// F5
630
KEY_MAP_WIN(F5, VK_F5)
631
KEY_MAP_COCOA(F5, kVK_F5)
632
KEY_MAP_GTK(F5, GDK_F5)
633
KEY_MAP_ANDROID(F5, AKEYCODE_F5)
634
635
// F6
636
KEY_MAP_WIN(F6, VK_F6)
637
KEY_MAP_COCOA(F6, kVK_F6)
638
KEY_MAP_GTK(F6, GDK_F6)
639
KEY_MAP_ANDROID(F6, AKEYCODE_F6)
640
641
// F7
642
KEY_MAP_WIN(F7, VK_F7)
643
KEY_MAP_COCOA(F7, kVK_F7)
644
KEY_MAP_GTK(F7, GDK_F7)
645
KEY_MAP_ANDROID(F7, AKEYCODE_F7)
646
647
// F8
648
KEY_MAP_WIN(F8, VK_F8)
649
KEY_MAP_COCOA(F8, kVK_F8)
650
KEY_MAP_GTK(F8, GDK_F8)
651
KEY_MAP_ANDROID(F8, AKEYCODE_F8)
652
653
// F9
654
KEY_MAP_WIN(F9, VK_F9)
655
KEY_MAP_COCOA(F9, kVK_F9)
656
KEY_MAP_GTK(F9, GDK_F9)
657
KEY_MAP_ANDROID(F9, AKEYCODE_F9)
658
659
// F10
660
KEY_MAP_WIN(F10, VK_F10)
661
KEY_MAP_COCOA(F10, kVK_F10)
662
KEY_MAP_GTK(F10, GDK_F10)
663
KEY_MAP_ANDROID(F10, AKEYCODE_F10)
664
665
// F11
666
KEY_MAP_WIN(F11, VK_F11)
667
KEY_MAP_COCOA(F11, kVK_F11)
668
KEY_MAP_GTK(F11, GDK_F11 /* same as GDK_L1 */)
669
KEY_MAP_ANDROID(F11, AKEYCODE_F11)
670
671
// F12
672
KEY_MAP_WIN(F12, VK_F12)
673
KEY_MAP_COCOA(F12, kVK_F12)
674
KEY_MAP_GTK(F12, GDK_F12 /* same as GDK_L2 */)
675
KEY_MAP_ANDROID(F12, AKEYCODE_F12)
676
677
// F13
678
KEY_MAP_WIN(F13, VK_F13)
679
KEY_MAP_COCOA(F13, kVK_F13)
680
KEY_MAP_GTK(F13, GDK_F13 /* same as GDK_L3 */)
681
682
// F14
683
KEY_MAP_WIN(F14, VK_F14)
684
KEY_MAP_COCOA(F14, kVK_F14)
685
KEY_MAP_GTK(F14, GDK_F14 /* same as GDK_L4 */)
686
687
// F15
688
KEY_MAP_WIN(F15, VK_F15)
689
KEY_MAP_COCOA(F15, kVK_F15)
690
KEY_MAP_GTK(F15, GDK_F15 /* same as GDK_L5 */)
691
692
// F16
693
KEY_MAP_WIN(F16, VK_F16)
694
KEY_MAP_COCOA(F16, kVK_F16)
695
KEY_MAP_GTK(F16, GDK_F16 /* same as GDK_L6 */)
696
697
// F17
698
KEY_MAP_WIN(F17, VK_F17)
699
KEY_MAP_COCOA(F17, kVK_F17)
700
KEY_MAP_GTK(F17, GDK_F17 /* same as GDK_L7 */)
701
702
// F18
703
KEY_MAP_WIN(F18, VK_F18)
704
KEY_MAP_COCOA(F18, kVK_F18)
705
KEY_MAP_GTK(F18, GDK_F18 /* same as GDK_L8 */)
706
707
// F19
708
KEY_MAP_WIN(F19, VK_F19)
709
KEY_MAP_COCOA(F19, kVK_F19)
710
KEY_MAP_GTK(F19, GDK_F19 /* same as GDK_L9 */)
711
712
// F20
713
KEY_MAP_WIN(F20, VK_F20)
714
KEY_MAP_GTK(F20, GDK_F20 /* same as GDK_L10 */)
715
716
// F21
717
KEY_MAP_WIN(F21, VK_F21)
718
KEY_MAP_GTK(F21, GDK_F21 /* same as GDK_R1 */)
719
720
// F22
721
KEY_MAP_WIN(F22, VK_F22)
722
KEY_MAP_GTK(F22, GDK_F22 /* same as GDK_R2 */)
723
724
// F23
725
KEY_MAP_WIN(F23, VK_F23)
726
KEY_MAP_GTK(F23, GDK_F23 /* same as GDK_R3 */)
727
728
// F24
729
KEY_MAP_WIN(F24, VK_F24)
730
KEY_MAP_GTK(F24, GDK_F24 /* same as GDK_R4 */)
731
732
// F25
733
KEY_MAP_GTK(F25, GDK_F25 /* same as GDK_R5 */)
734
735
// F26
736
KEY_MAP_GTK(F26, GDK_F26 /* same as GDK_R6 */)
737
738
// F27
739
KEY_MAP_GTK(F27, GDK_F27 /* same as GDK_R7 */)
740
741
// F28
742
KEY_MAP_GTK(F28, GDK_F28 /* same as GDK_R8 */)
743
744
// F29
745
KEY_MAP_GTK(F29, GDK_F29 /* same as GDK_R9 */)
746
747
// F30
748
KEY_MAP_GTK(F30, GDK_F30 /* same as GDK_R10 */)
749
750
// F31
751
KEY_MAP_GTK(F31, GDK_F31 /* same as GDK_R11 */)
752
753
// F32
754
KEY_MAP_GTK(F32, GDK_F32 /* same as GDK_R12 */)
755
756
// F33
757
KEY_MAP_GTK(F33, GDK_F33 /* same as GDK_R13 */)
758
759
// F34
760
KEY_MAP_GTK(F34, GDK_F34 /* same as GDK_R14 */)
761
762
// F35
763
KEY_MAP_GTK(F35, GDK_F35 /* same as GDK_R15 */)
764
765
/******************************************************************************
766
* Multimedia Keys
767
******************************************************************************/
768
// ChannelDown
769
KEY_MAP_WIN_CMD(ChannelDown, APPCOMMAND_MEDIA_CHANNEL_DOWN)
770
KEY_MAP_ANDROID(ChannelDown, AKEYCODE_CHANNEL_DOWN)
771
772
// ChannelUp
773
KEY_MAP_WIN_CMD(ChannelUp, APPCOMMAND_MEDIA_CHANNEL_UP)
774
KEY_MAP_ANDROID(ChannelUp, AKEYCODE_CHANNEL_UP)
775
776
// Close
777
// NOTE: This is not a key to close disk tray, this is a key to close document
778
// or window.
779
KEY_MAP_WIN_CMD(Close, APPCOMMAND_CLOSE)
780
KEY_MAP_GTK(Close, GDK_Close)
781
782
// MailForward
783
KEY_MAP_WIN_CMD(MailForward, APPCOMMAND_FORWARD_MAIL)
784
KEY_MAP_GTK(MailForward, GDK_MailForward)
785
786
// MailReply
787
KEY_MAP_WIN_CMD(MailReply, APPCOMMAND_REPLY_TO_MAIL)
788
KEY_MAP_GTK(MailReply, GDK_Reply)
789
790
// MailSend
791
KEY_MAP_WIN_CMD(MailSend, APPCOMMAND_SEND_MAIL)
792
KEY_MAP_GTK(MailSend, GDK_Send)
793
794
// MediaFastForward
795
KEY_MAP_WIN_CMD(MediaFastForward, APPCOMMAND_MEDIA_FAST_FORWARD)
796
KEY_MAP_GTK(MediaFastForward, GDK_AudioForward)
797
KEY_MAP_ANDROID(MediaFastForward, AKEYCODE_MEDIA_FAST_FORWARD)
798
799
// MediaPause
800
KEY_MAP_WIN_CMD(MediaPause, APPCOMMAND_MEDIA_PAUSE)
801
KEY_MAP_GTK(MediaPause, GDK_AudioPause)
802
KEY_MAP_ANDROID(MediaPause, AKEYCODE_MEDIA_PAUSE)
803
804
// MediaPlay
805
KEY_MAP_WIN_CMD(MediaPlay, APPCOMMAND_MEDIA_PLAY)
806
KEY_MAP_GTK(MediaPlay, GDK_AudioPlay)
807
KEY_MAP_ANDROID(MediaPlay, AKEYCODE_MEDIA_PLAY)
808
809
// MediaPlayPause
810
KEY_MAP_WIN(MediaPlayPause, VK_MEDIA_PLAY_PAUSE)
811
KEY_MAP_WIN_CMD(MediaPlayPause, APPCOMMAND_MEDIA_PLAY_PAUSE)
812
KEY_MAP_ANDROID(MediaPlayPause, AKEYCODE_MEDIA_PLAY_PAUSE)
813
814
// MediaRecord
815
KEY_MAP_WIN_CMD(MediaRecord, APPCOMMAND_MEDIA_RECORD)
816
KEY_MAP_GTK(MediaRecord, GDK_AudioRecord)
817
KEY_MAP_ANDROID(MediaRecord, AKEYCODE_MEDIA_RECORD)
818
819
// MediaRewind
820
KEY_MAP_WIN_CMD(MediaRewind, APPCOMMAND_MEDIA_REWIND)
821
KEY_MAP_GTK(MediaRewind, GDK_AudioRewind)
822
KEY_MAP_ANDROID(MediaRewind, AKEYCODE_MEDIA_REWIND)
823
824
// MediaStop
825
KEY_MAP_WIN(MediaStop, VK_MEDIA_STOP)
826
KEY_MAP_WIN_CMD(MediaStop, APPCOMMAND_MEDIA_STOP)
827
KEY_MAP_GTK(MediaStop, GDK_AudioStop)
828
KEY_MAP_ANDROID(MediaStop, AKEYCODE_MEDIA_STOP)
829
830
// MediaTrackNext
831
KEY_MAP_WIN(MediaTrackNext, VK_MEDIA_NEXT_TRACK)
832
KEY_MAP_WIN_CMD(MediaTrackNext, APPCOMMAND_MEDIA_NEXTTRACK)
833
KEY_MAP_GTK(MediaTrackNext, GDK_AudioNext)
834
KEY_MAP_ANDROID(MediaTrackNext, AKEYCODE_MEDIA_NEXT)
835
836
// MediaTrackPrevious
837
KEY_MAP_WIN(MediaTrackPrevious, VK_MEDIA_PREV_TRACK)
838
KEY_MAP_WIN_CMD(MediaTrackPrevious, APPCOMMAND_MEDIA_PREVIOUSTRACK)
839
KEY_MAP_GTK(MediaTrackPrevious, GDK_AudioPrev)
840
KEY_MAP_ANDROID(MediaTrackPrevious, AKEYCODE_MEDIA_PREVIOUS)
841
842
// New
843
KEY_MAP_WIN_CMD(New, APPCOMMAND_NEW)
844
KEY_MAP_GTK(New, GDK_New)
845
846
// Open
847
KEY_MAP_WIN_CMD(Open, APPCOMMAND_OPEN)
848
KEY_MAP_GTK(Open, GDK_Open)
849
850
// Print
851
KEY_MAP_WIN_CMD(Print, APPCOMMAND_PRINT)
852
853
// Save
854
KEY_MAP_WIN_CMD(Save, APPCOMMAND_SAVE)
855
KEY_MAP_GTK(Save, GDK_Save)
856
857
// SpellCheck
858
KEY_MAP_WIN_CMD(SpellCheck, APPCOMMAND_SPELL_CHECK)
859
KEY_MAP_GTK(SpellCheck, GDK_Spell)
860
861
/******************************************************************************
862
* Audio Keys
863
*****************************************************************************/
864
// AudioBassBoostDown
865
KEY_MAP_WIN_CMD(AudioBassBoostDown, APPCOMMAND_BASS_DOWN)
866
867
// AudioBassBoostUp
868
KEY_MAP_WIN_CMD(AudioBassBoostUp, APPCOMMAND_BASS_UP)
869
870
// AudioVolumeDown
871
KEY_MAP_WIN(AudioVolumeDown, VK_VOLUME_DOWN)
872
KEY_MAP_WIN_CMD(AudioVolumeDown, APPCOMMAND_VOLUME_DOWN)
873
KEY_MAP_COCOA(AudioVolumeDown, kVK_VolumeDown)
874
KEY_MAP_GTK(AudioVolumeDown, GDK_AudioLowerVolume)
875
KEY_MAP_ANDROID(AudioVolumeDown, AKEYCODE_VOLUME_DOWN)
876
877
// AudioVolumeUp
878
KEY_MAP_WIN(AudioVolumeUp, VK_VOLUME_UP)
879
KEY_MAP_WIN_CMD(AudioVolumeUp, APPCOMMAND_VOLUME_UP)
880
KEY_MAP_COCOA(AudioVolumeUp, kVK_VolumeUp)
881
KEY_MAP_GTK(AudioVolumeUp, GDK_AudioRaiseVolume)
882
KEY_MAP_ANDROID(AudioVolumeUp, AKEYCODE_VOLUME_UP)
883
884
// AudioVolumeMute
885
KEY_MAP_WIN(AudioVolumeMute, VK_VOLUME_MUTE)
886
KEY_MAP_WIN_CMD(AudioVolumeMute, APPCOMMAND_VOLUME_MUTE)
887
KEY_MAP_COCOA(AudioVolumeMute, kVK_Mute)
888
KEY_MAP_GTK(AudioVolumeMute, GDK_AudioMute)
889
KEY_MAP_ANDROID(AudioVolumeMute, AKEYCODE_VOLUME_MUTE)
890
891
// MicrophoneVolumeMute
892
KEY_MAP_ANDROID(MicrophoneVolumeMute, AKEYCODE_MUTE)
893
894
/******************************************************************************
895
* Application Keys
896
******************************************************************************/
897
// LaunchCalculator
898
KEY_MAP_GTK(LaunchCalculator, GDK_Calculator)
899
KEY_MAP_ANDROID(LaunchCalculator, AKEYCODE_CALCULATOR)
900
901
// LaunchCalendar
902
KEY_MAP_GTK(LaunchCalendar, GDK_Calendar)
903
KEY_MAP_ANDROID(LaunchCalendar, AKEYCODE_CALENDAR)
904
905
// LaunchContacts
906
KEY_MAP_ANDROID(LaunchContacts, AKEYCODE_CONTACTS)
907
908
// LaunchMail
909
KEY_MAP_WIN(LaunchMail, VK_LAUNCH_MAIL)
910
KEY_MAP_WIN_CMD(LaunchMail, APPCOMMAND_LAUNCH_MAIL)
911
KEY_MAP_GTK(LaunchMail, GDK_Mail)
912
KEY_MAP_ANDROID(LaunchMail, AKEYCODE_ENVELOPE)
913
914
// LaunchMediaPlayer
915
KEY_MAP_WIN(LaunchMediaPlayer, VK_LAUNCH_MEDIA_SELECT)
916
KEY_MAP_WIN_CMD(LaunchMediaPlayer, APPCOMMAND_LAUNCH_MEDIA_SELECT)
917
// GDK_CD is defined as "Launch CD/DVD player" in XF86keysym.h.
918
// Therefore, let's map it to media player rather than music player.
919
KEY_MAP_GTK(LaunchMediaPlayer, GDK_CD)
920
KEY_MAP_GTK(LaunchMediaPlayer, GDK_Video)
921
KEY_MAP_GTK(LaunchMediaPlayer, GDK_AudioMedia)
922
923
// LaunchMusicPlayer
924
KEY_MAP_GTK(LaunchMusicPlayer, GDK_Music)
925
KEY_MAP_ANDROID(LaunchMusicPlayer, AKEYCODE_MUSIC)
926
927
// LaunchMyComputer
928
KEY_MAP_GTK(LaunchMyComputer, GDK_MyComputer)
929
KEY_MAP_GTK(LaunchMyComputer, GDK_Explorer)
930
931
// LaunchScreenSaver
932
KEY_MAP_GTK(LaunchScreenSaver, GDK_ScreenSaver)
933
934
// LaunchSpreadsheet
935
KEY_MAP_GTK(LaunchSpreadsheet, GDK_Excel)
936
937
// LaunchWebBrowser
938
KEY_MAP_GTK(LaunchWebBrowser, GDK_WWW)
939
KEY_MAP_ANDROID(LaunchWebBrowser, AKEYCODE_EXPLORER)
940
941
// LaunchWebCam
942
KEY_MAP_GTK(LaunchWebCam, GDK_WebCam)
943
944
// LaunchWordProcessor
945
KEY_MAP_GTK(LaunchWordProcessor, GDK_Word)
946
947
// LaunchApplication1
948
KEY_MAP_WIN(LaunchApplication1, VK_LAUNCH_APP1)
949
KEY_MAP_WIN_CMD(LaunchApplication1, APPCOMMAND_LAUNCH_APP1)
950
KEY_MAP_GTK(LaunchApplication1, GDK_Launch0)
951
952
// LaunchApplication2
953
KEY_MAP_WIN(LaunchApplication2, VK_LAUNCH_APP2)
954
KEY_MAP_WIN_CMD(LaunchApplication2, APPCOMMAND_LAUNCH_APP2)
955
KEY_MAP_GTK(LaunchApplication2, GDK_Launch1)
956
957
// LaunchApplication3
958
KEY_MAP_GTK(LaunchApplication3, GDK_Launch2)
959
960
// LaunchApplication4
961
KEY_MAP_GTK(LaunchApplication4, GDK_Launch3)
962
963
// LaunchApplication5
964
KEY_MAP_GTK(LaunchApplication5, GDK_Launch4)
965
966
// LaunchApplication6
967
KEY_MAP_GTK(LaunchApplication6, GDK_Launch5)
968
969
// LaunchApplication7
970
KEY_MAP_GTK(LaunchApplication7, GDK_Launch6)
971
972
// LaunchApplication8
973
KEY_MAP_GTK(LaunchApplication8, GDK_Launch7)
974
975
// LaunchApplication9
976
KEY_MAP_GTK(LaunchApplication9, GDK_Launch8)
977
978
// LaunchApplication10
979
KEY_MAP_GTK(LaunchApplication10, GDK_Launch9)
980
981
// LaunchApplication11
982
KEY_MAP_GTK(LaunchApplication11, GDK_LaunchA)
983
984
// LaunchApplication12
985
KEY_MAP_GTK(LaunchApplication12, GDK_LaunchB)
986
987
// LaunchApplication13
988
KEY_MAP_GTK(LaunchApplication13, GDK_LaunchC)
989
990
// LaunchApplication14
991
KEY_MAP_GTK(LaunchApplication14, GDK_LaunchD)
992
993
// LaunchApplication15
994
KEY_MAP_GTK(LaunchApplication15, GDK_LaunchE)
995
996
// LaunchApplication16
997
KEY_MAP_GTK(LaunchApplication16, GDK_LaunchF)
998
999
// LaunchApplication17
1000
1001
// LaunchApplication18
1002
1003
/******************************************************************************
1004
* Browser Keys
1005
******************************************************************************/
1006
// BrowserBack
1007
KEY_MAP_WIN(BrowserBack, VK_BROWSER_BACK)
1008
KEY_MAP_WIN_CMD(BrowserBack, APPCOMMAND_BROWSER_BACKWARD)
1009
KEY_MAP_GTK(BrowserBack, GDK_Back)
1010
1011
// BrowserFavorites
1012
KEY_MAP_WIN(BrowserFavorites, VK_BROWSER_FAVORITES)
1013
KEY_MAP_WIN_CMD(BrowserFavorites, APPCOMMAND_BROWSER_FAVORITES)
1014
KEY_MAP_ANDROID(BrowserFavorites, AKEYCODE_BOOKMARK)
1015
1016
// BrowserForward
1017
KEY_MAP_WIN(BrowserForward, VK_BROWSER_FORWARD)
1018
KEY_MAP_WIN_CMD(BrowserForward, APPCOMMAND_BROWSER_FORWARD)
1019
KEY_MAP_GTK(BrowserForward, GDK_Forward)
1020
KEY_MAP_ANDROID(BrowserForward, AKEYCODE_FORWARD)
1021
1022
// BrowserHome
1023
KEY_MAP_WIN(BrowserHome, VK_BROWSER_HOME)
1024
KEY_MAP_WIN_CMD(BrowserHome, APPCOMMAND_BROWSER_HOME)
1025
KEY_MAP_GTK(BrowserHome, GDK_HomePage)
1026
1027
// BrowserRefresh
1028
KEY_MAP_WIN(BrowserRefresh, VK_BROWSER_REFRESH)
1029
KEY_MAP_WIN_CMD(BrowserRefresh, APPCOMMAND_BROWSER_REFRESH)
1030
KEY_MAP_GTK(BrowserRefresh, GDK_Refresh)
1031
KEY_MAP_GTK(BrowserRefresh, GDK_Reload)
1032
1033
// BrowserSearch
1034
KEY_MAP_WIN(BrowserSearch, VK_BROWSER_SEARCH)
1035
KEY_MAP_WIN_CMD(BrowserSearch, APPCOMMAND_BROWSER_SEARCH)
1036
KEY_MAP_GTK(BrowserSearch, GDK_Search)
1037
KEY_MAP_ANDROID(BrowserSearch, AKEYCODE_SEARCH)
1038
1039
// BrowserStop
1040
KEY_MAP_WIN(BrowserStop, VK_BROWSER_STOP)
1041
KEY_MAP_WIN_CMD(BrowserStop, APPCOMMAND_BROWSER_STOP)
1042
KEY_MAP_GTK(BrowserStop, GDK_Stop)
1043
1044
/******************************************************************************
1045
* Mobile Phone Keys
1046
******************************************************************************/
1047
// AppSwitch
1048
KEY_MAP_ANDROID(AppSwitch, AKEYCODE_APP_SWITCH)
1049
1050
// Call
1051
KEY_MAP_ANDROID(Call, AKEYCODE_CALL)
1052
1053
// Camera
1054
KEY_MAP_ANDROID(Camera, AKEYCODE_CAMERA)
1055
1056
// CameraFocus
1057
KEY_MAP_ANDROID(CameraFocus, AKEYCODE_FOCUS)
1058
1059
// EndCall
1060
KEY_MAP_ANDROID(EndCall, AKEYCODE_ENDCALL)
1061
1062
// GoBack
1063
KEY_MAP_ANDROID(GoBack, AKEYCODE_BACK)
1064
1065
// GoHome
1066
KEY_MAP_ANDROID(GoHome, AKEYCODE_HOME)
1067
1068
// HeadsetHook
1069
KEY_MAP_ANDROID(HeadsetHook, AKEYCODE_HEADSETHOOK)
1070
1071
// Notification
1072
KEY_MAP_ANDROID(Notification, AKEYCODE_NOTIFICATION)
1073
1074
// MannerMode
1075
KEY_MAP_ANDROID(MannerMode, AKEYCODE_MANNER_MODE)
1076
1077
/******************************************************************************
1078
* TV Keys
1079
******************************************************************************/
1080
// TV
1081
KEY_MAP_ANDROID(TV, AKEYCODE_TV)
1082
1083
// TV3DMode
1084
KEY_MAP_ANDROID(TV3DMode, AKEYCODE_3D_MODE)
1085
1086
// TVAntennaCable
1087
KEY_MAP_ANDROID(TVAntennaCable, AKEYCODE_TV_ANTENNA_CABLE)
1088
1089
// TVAudioDescription
1090
KEY_MAP_ANDROID(TVAudioDescription, AKEYCODE_TV_AUDIO_DESCRIPTION)
1091
1092
// TVAudioDescriptionMixDown
1093
KEY_MAP_ANDROID(TVAudioDescriptionMixDown,
1094
AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN)
1095
1096
// TVAudioDescriptionMixUp
1097
KEY_MAP_ANDROID(TVAudioDescriptionMixUp, AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP)
1098
1099
// TVContentsMenu
1100
KEY_MAP_ANDROID(TVContentsMenu, AKEYCODE_TV_CONTENTS_MENU)
1101
1102
// TVDataService
1103
KEY_MAP_ANDROID(TVDataService, AKEYCODE_TV_DATA_SERVICE)
1104
1105
// TVInput
1106
KEY_MAP_ANDROID(TVInput, AKEYCODE_TV_INPUT)
1107
1108
// TVInputComponent1
1109
KEY_MAP_ANDROID(TVInputComponent1, AKEYCODE_TV_INPUT_COMPONENT_1)
1110
1111
// TVInputComponent2
1112
KEY_MAP_ANDROID(TVInputComponent2, AKEYCODE_TV_INPUT_COMPONENT_2)
1113
1114
// TVInputComposite1
1115
KEY_MAP_ANDROID(TVInputComposite1, AKEYCODE_TV_INPUT_COMPOSITE_1)
1116
1117
// TVInputComposite2
1118
KEY_MAP_ANDROID(TVInputComposite2, AKEYCODE_TV_INPUT_COMPOSITE_2)
1119
1120
// TVInputHDMI1
1121
KEY_MAP_ANDROID(TVInputHDMI1, AKEYCODE_TV_INPUT_HDMI_1)
1122
1123
// TVInputHDMI2
1124
KEY_MAP_ANDROID(TVInputHDMI2, AKEYCODE_TV_INPUT_HDMI_2)
1125
1126
// TVInputHDMI3
1127
KEY_MAP_ANDROID(TVInputHDMI3, AKEYCODE_TV_INPUT_HDMI_3)
1128
1129
// TVInputHDMI4
1130
KEY_MAP_ANDROID(TVInputHDMI4, AKEYCODE_TV_INPUT_HDMI_4)
1131
1132
// TVInputVGA1
1133
KEY_MAP_ANDROID(TVInputVGA1, AKEYCODE_TV_INPUT_VGA_1)
1134
1135
// TVNetwork
1136
KEY_MAP_ANDROID(TVNetwork, AKEYCODE_TV_NETWORK)
1137
1138
// TVNumberEntry
1139
KEY_MAP_ANDROID(TVNumberEntry, AKEYCODE_TV_NUMBER_ENTRY)
1140
1141
// TVPower
1142
KEY_MAP_ANDROID(TVPower, AKEYCODE_TV_POWER)
1143
1144
// TVRadioService
1145
KEY_MAP_ANDROID(TVRadioService, AKEYCODE_TV_RADIO_SERVICE)
1146
1147
// TVSatellite
1148
KEY_MAP_ANDROID(TVSatellite, AKEYCODE_TV_SATELLITE)
1149
1150
// TVSatelliteBS
1151
KEY_MAP_ANDROID(TVSatelliteBS, AKEYCODE_TV_SATELLITE_BS)
1152
1153
// TVSatelliteCS
1154
KEY_MAP_ANDROID(TVSatelliteCS, AKEYCODE_TV_SATELLITE_CS)
1155
1156
// TVSatelliteToggle
1157
KEY_MAP_ANDROID(TVSatelliteToggle, AKEYCODE_TV_SATELLITE_SERVICE)
1158
1159
// TVTerrestrialAnalog
1160
KEY_MAP_ANDROID(TVTerrestrialAnalog, AKEYCODE_TV_TERRESTRIAL_ANALOG)
1161
1162
// TVTerrestrialDigital
1163
KEY_MAP_ANDROID(TVTerrestrialDigital, AKEYCODE_TV_TERRESTRIAL_DIGITAL)
1164
1165
// TVTimer
1166
KEY_MAP_ANDROID(TVTimer, AKEYCODE_TV_TIMER_PROGRAMMING)
1167
1168
/******************************************************************************
1169
* Media Controller Keys
1170
******************************************************************************/
1171
// AVRInput
1172
KEY_MAP_ANDROID(AVRInput, AKEYCODE_AVR_INPUT)
1173
1174
// AVRPower
1175
KEY_MAP_ANDROID(AVRPower, AKEYCODE_AVR_POWER)
1176
1177
// ColorF0Red
1178
KEY_MAP_GTK(ColorF0Red, GDK_Red)
1179
KEY_MAP_ANDROID(ColorF0Red, AKEYCODE_PROG_RED)
1180
1181
// ColorF1Green
1182
KEY_MAP_GTK(ColorF1Green, GDK_Green)
1183
KEY_MAP_ANDROID(ColorF1Green, AKEYCODE_PROG_GREEN)
1184
1185
// ColorF2Yellow
1186
KEY_MAP_GTK(ColorF2Yellow, GDK_Yellow)
1187
KEY_MAP_ANDROID(ColorF2Yellow, AKEYCODE_PROG_YELLOW)
1188
1189
// ColorF3Blue
1190
KEY_MAP_GTK(ColorF3Blue, GDK_Blue)
1191
KEY_MAP_ANDROID(ColorF3Blue, AKEYCODE_PROG_BLUE)
1192
1193
// ClosedCaptionToggle
1194
KEY_MAP_ANDROID(ClosedCaptionToggle, AKEYCODE_CAPTIONS)
1195
1196
// Dimmer
1197
KEY_MAP_GTK(Dimmer, GDK_BrightnessAdjust)
1198
1199
// DVR
1200
KEY_MAP_ANDROID(DVR, AKEYCODE_DVR)
1201
1202
// Guide
1203
KEY_MAP_ANDROID(Guide, AKEYCODE_GUIDE)
1204
1205
// Info
1206
KEY_MAP_ANDROID(Info, AKEYCODE_INFO)
1207
1208
// MediaAudioTrack
1209
KEY_MAP_ANDROID(MediaAudioTrack, AKEYCODE_MEDIA_AUDIO_TRACK)
1210
1211
// MediaLast
1212
KEY_MAP_ANDROID(MediaLast, AKEYCODE_LAST_CHANNEL)
1213
1214
// MediaTopMenu
1215
KEY_MAP_ANDROID(MediaTopMenu, AKEYCODE_MEDIA_TOP_MENU)
1216
1217
// MediaSkipBackward
1218
KEY_MAP_ANDROID(MediaSkipBackward, AKEYCODE_MEDIA_SKIP_BACKWARD)
1219
1220
// MediaSkipForward
1221
KEY_MAP_ANDROID(MediaSkipForward, AKEYCODE_MEDIA_SKIP_FORWARD)
1222
1223
// MediaStepBackward
1224
KEY_MAP_ANDROID(MediaStepBackward, AKEYCODE_MEDIA_STEP_BACKWARD)
1225
1226
// MediaStepForward
1227
KEY_MAP_ANDROID(MediaStepForward, AKEYCODE_MEDIA_STEP_FORWARD)
1228
1229
// NavigateIn
1230
KEY_MAP_ANDROID(NavigateIn, AKEYCODE_NAVIGATE_IN)
1231
1232
// NavigateNext
1233
KEY_MAP_ANDROID(NavigateNext, AKEYCODE_NAVIGATE_NEXT)
1234
1235
// NavigateOut
1236
KEY_MAP_ANDROID(NavigateOut, AKEYCODE_NAVIGATE_OUT)
1237
1238
// NavigatePrevious
1239
KEY_MAP_ANDROID(NavigatePrevious, AKEYCODE_NAVIGATE_PREVIOUS)
1240
1241
// Pairing
1242
KEY_MAP_ANDROID(Pairing, AKEYCODE_PAIRING)
1243
1244
// PinPToggle
1245
KEY_MAP_ANDROID(PinPToggle, AKEYCODE_WINDOW)
1246
1247
// RandomToggle
1248
KEY_MAP_GTK(RandomToggle, GDK_AudioRandomPlay)
1249
1250
// Settings
1251
KEY_MAP_ANDROID(Settings, AKEYCODE_SETTINGS)
1252
1253
// STBInput
1254
KEY_MAP_ANDROID(STBInput, AKEYCODE_STB_INPUT)
1255
1256
// STBPower
1257
KEY_MAP_ANDROID(STBPower, AKEYCODE_STB_POWER)
1258
1259
// Subtitle
1260
KEY_MAP_GTK(Subtitle, GDK_Subtitle)
1261
1262
// Teletext
1263
KEY_MAP_ANDROID(Teletext, AKEYCODE_TV_TELETEXT)
1264
1265
// VideoModeNext
1266
KEY_MAP_GTK(VideoModeNext, GDK_Next_VMode)
1267
1268
// ZoomToggle
1269
KEY_MAP_WIN(ZoomToggle, VK_ZOOM)
1270
KEY_MAP_ANDROID(ZoomToggle, AKEYCODE_TV_ZOOM_MODE)
1271
1272
/******************************************************************************
1273
* Keys not defined by any standards
1274
******************************************************************************/
1275
// SoftLeft
1276
KEY_MAP_ANDROID(SoftLeft, AKEYCODE_SOFT_LEFT)
1277
1278
// SoftRight
1279
KEY_MAP_ANDROID(SoftRight, AKEYCODE_SOFT_RIGHT)
1280
1281
#undef KEY_MAP_WIN
1282
#undef KEY_MAP_WIN_JPN
1283
#undef KEY_MAP_WIN_KOR
1284
#undef KEY_MAP_WIN_OTH
1285
#undef KEY_MAP_WIN_CMD
1286
#undef KEY_MAP_COCOA
1287
#undef KEY_MAP_GTK
1288
#undef KEY_MAP_ANDROID