3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #define X_ESC X_ESCAPE
24 #define X_BSPC X_BSPACE
26 #define X_MINS X_MINUS
28 #define X_LBRC X_LBRACKET
29 #define X_RBRC X_RBRACKET
30 #define X_BSLS X_BSLASH
31 #define X_NUHS X_NONUS_HASH
32 #define X_SCLN X_SCOLON
33 #define X_QUOT X_QUOTE
35 #define X_COMM X_COMMA
36 #define X_SLSH X_SLASH
37 #define X_NUBS X_NONUS_BSLASH
40 #define X_CLCK X_CAPSLOCK
41 #define X_CAPS X_CAPSLOCK
42 #define X_SLCK X_SCROLLLOCK
43 #define X_NLCK X_NUMLOCK
44 #define X_LCAP X_LOCKING_CAPS
45 #define X_LNUM X_LOCKING_NUM
46 #define X_LSCR X_LOCKING_SCROLL
49 #define X_PSCR X_PSCREEN
50 #define X_PAUS X_PAUSE
52 #define X_INS X_INSERT
53 #define X_DEL X_DELETE
54 #define X_PGDN X_PGDOWN
55 #define X_RGHT X_RIGHT
56 #define X_APP X_APPLICATION
57 #define X_EXEC X_EXECUTE
58 #define X_SLCT X_SELECT
59 #define X_AGIN X_AGAIN
60 #define X_PSTE X_PASTE
61 #define X_ERAS X_ALT_ERASE
65 #define X_PSLS X_KP_SLASH
66 #define X_PAST X_KP_ASTERISK
67 #define X_PMNS X_KP_MINUS
68 #define X_PPLS X_KP_PLUS
69 #define X_PENT X_KP_ENTER
80 #define X_PDOT X_KP_DOT
81 #define X_PEQL X_KP_EQUAL
82 #define X_PCMM X_KP_COMMA
84 /* Japanese specific */
85 #define X_ZKHK X_GRAVE
93 #define X_HAEN X_LANG1
94 #define X_HANJ X_LANG2
97 #define X_LCTL X_LCTRL
98 #define X_LSFT X_LSHIFT
100 #define X_LWIN X_LGUI
101 #define X_RCTL X_RCTRL
102 #define X_RSFT X_RSHIFT
103 #define X_ALGR X_RALT
104 #define X_RCMD X_RGUI
105 #define X_RWIN X_RGUI
107 /* Generic Desktop Page (0x01) */
108 #define X_PWR X_SYSTEM_POWER
109 #define X_SLEP X_SYSTEM_SLEEP
110 #define X_WAKE X_SYSTEM_WAKE
112 /* Consumer Page (0x0C) */
113 #define X_MUTE X_AUDIO_MUTE
114 #define X_VOLU X_AUDIO_VOL_UP
115 #define X_VOLD X_AUDIO_VOL_DOWN
116 #define X_MNXT X_MEDIA_NEXT_TRACK
117 #define X_MPRV X_MEDIA_PREV_TRACK
118 #define X_MSTP X_MEDIA_STOP
119 #define X_MPLY X_MEDIA_PLAY_PAUSE
120 #define X_MSEL X_MEDIA_SELECT
121 #define X_EJCT X_MEDIA_EJECT
122 #define X_CALC X_CALCULATOR
123 #define X_MYCM X_MY_COMPUTER
124 #define X_WSCH X_WWW_SEARCH
125 #define X_WHOM X_WWW_HOME
126 #define X_WBAK X_WWW_BACK
127 #define X_WFWD X_WWW_FORWARD
128 #define X_WSTP X_WWW_STOP
129 #define X_WREF X_WWW_REFRESH
130 #define X_WFAV X_WWW_FAVORITES
131 #define X_MFFD X_MEDIA_FAST_FORWARD
132 #define X_MRWD X_MEDIA_REWIND
133 #define X_BRIU X_BRIGHTNESS_UP
134 #define X_BRID X_BRIGHTNESS_DOWN
136 /* System Specific */
137 #define X_BRMU X_PAUSE
138 #define X_BRMD X_SCROLLLOCK
140 /* Keyboard/Keypad Page (0x07) */
184 #define X_LBRACKET 2f
185 #define X_RBRACKET 30
187 #define X_NONUS_HASH 32
194 #define X_CAPSLOCK 39
208 #define X_SCROLLLOCK 47
221 #define X_KP_SLASH 54
222 #define X_KP_ASTERISK 55
223 #define X_KP_MINUS 56
225 #define X_KP_ENTER 58
237 #define X_NONUS_BSLASH 64
238 #define X_APPLICATION 65
240 #define X_KP_EQUAL 67
266 #define X__VOLDOWN 81
267 #define X_LOCKING_CAPS 82
268 #define X_LOCKING_NUM 83
269 #define X_LOCKING_SCROLL 84
270 #define X_KP_COMMA 85
271 #define X_KP_EQUAL_AS400 86
290 #define X_ALT_ERASE 99
296 #define X_SEPARATOR 9f
299 #define X_CLEAR_AGAIN a2
313 /* Media and Function keys */
314 /* Generic Desktop Page (0x01) */
315 #define X_SYSTEM_POWER a5
316 #define X_SYSTEM_SLEEP a6
317 #define X_SYSTEM_WAKE a7
319 /* Consumer Page (0x0C) */
320 #define X_AUDIO_MUTE a8
321 #define X_AUDIO_VOL_UP a9
322 #define X_AUDIO_VOL_DOWN aa
323 #define X_MEDIA_NEXT_TRACK ab
324 #define X_MEDIA_PREV_TRACK ac
325 #define X_MEDIA_STOP ad
326 #define X_MEDIA_PLAY_PAUSE ae
327 #define X_MEDIA_SELECT af
328 #define X_MEDIA_EJECT b0
330 #define X_CALCULATOR b2
331 #define X_MY_COMPUTER b3
332 #define X_WWW_SEARCH b4
333 #define X_WWW_HOME b5
334 #define X_WWW_BACK b6
335 #define X_WWW_FORWARD b7
336 #define X_WWW_STOP b8
337 #define X_WWW_REFRESH b9
338 #define X_WWW_FAVORITES ba
339 #define X_MEDIA_FAST_FORWARD bb
340 #define X_MEDIA_REWIND bc
341 #define X_BRIGHTNESS_UP bd
342 #define X_BRIGHTNESS_DOWN be
344 // Send string macros
345 #define STRINGIZE(z) #z
346 #define ADD_SLASH_X(y) STRINGIZE(\x##y)
347 #define SYMBOL_STR(x) ADD_SLASH_X(x)
349 #define SS_TAP_CODE 1
350 #define SS_DOWN_CODE 2
353 #define SS_TAP(keycode) "\1" SYMBOL_STR(keycode)
354 #define SS_DOWN(keycode) "\2" SYMBOL_STR(keycode)
355 #define SS_UP(keycode) "\3" SYMBOL_STR(keycode)
357 // `string` arguments must not be parenthesized
358 #define SS_LCTL(string) SS_DOWN(X_LCTL) string SS_UP(X_LCTL)
359 #define SS_LSFT(string) SS_DOWN(X_LSFT) string SS_UP(X_LSFT)
360 #define SS_LALT(string) SS_DOWN(X_LALT) string SS_UP(X_LALT)
361 #define SS_LGUI(string) SS_DOWN(X_LGUI) string SS_UP(X_LGUI)
362 #define SS_LCMD(string) SS_LGUI(string)
363 #define SS_LWIN(string) SS_LGUI(string)
365 #define SS_RCTL(string) SS_DOWN(X_RCTL) string SS_UP(X_RCTL)
366 #define SS_RSFT(string) SS_DOWN(X_RSFT) string SS_UP(X_RSFT)
367 #define SS_RALT(string) SS_DOWN(X_RALT) string SS_UP(X_RALT)
368 #define SS_RGUI(string) SS_DOWN(X_RGUI) string SS_UP(X_RGUI)
369 #define SS_ALGR(string) SS_RALT(string)
370 #define SS_RCMD(string) SS_RGUI(string)
371 #define SS_RWIN(string) SS_RGUI(string)
374 #define SS_LCTRL(string) SS_LCTL(string)