1 /* Copyright (C) 2011 by Jacob Alexander
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 // ----- Defines -----
29 #define KEY_SHIFT 0x02
32 #define KEY_LEFT_CTRL 0x01
33 #define KEY_LEFT_SHIFT 0x02
34 #define KEY_LEFT_ALT 0x04
35 #define KEY_LEFT_GUI 0x08
36 #define KEY_RIGHT_CTRL 0x10
37 #define KEY_RIGHT_SHIFT 0x20
38 #define KEY_RIGHT_ALT 0x40
39 #define KEY_RIGHT_GUI 0x80
42 #define KEY_NOEVENT 0 // Event, not a physical key
43 #define KEY_ERRORROLLOVER 1 // Event, not a physical key
44 #define KEY_POSTFAIL 2 // Event, not a physical key
45 #define KEY_ERRORUNDEFINED 3 // Event, not a physical key
84 #define KEY_BACKSPACE 42
89 #define KEY_LEFT_BRACE 47
90 #define KEY_RIGHT_BRACE 48
91 #define KEY_BACKSLASH 49
93 #define KEY_SEMICOLON 51
99 #define KEY_CAPS_LOCK 57
112 #define KEY_PRINTSCREEN 70
113 #define KEY_SCROLL_LOCK 71
115 #define KEY_INSERT 73
117 #define KEY_PAGE_UP 75
118 #define KEY_DELETE 76
120 #define KEY_PAGE_DOWN 78
125 #define KEY_NUM_LOCK 83
126 #define KEYPAD_SLASH 84
127 #define KEYPAD_ASTERIX 85
128 #define KEYPAD_MINUS 86
129 #define KEYPAD_PLUS 87
130 #define KEYPAD_ENTER 88
141 #define KEYPAD_PERIOD 99
142 #define KEY_ISO_BACKSLASH 100
144 #define KEYBOARD_ERROR 102 // See spec
145 #define KEYPAD_EQUAL 103
161 #define KEY_SELECT 119
163 #define KEY_AGAIN 121
167 #define KEY_PASTE 125
170 #define KEY_VOL_UP 128
171 #define KEY_VOL_DOWN 129
172 #define KEY_CAPS_LLOCK 130 // "Locking" Scroll Lock (Old keyboards with Locking Caps Lock)
173 #define KEY_NUM_LLOCK 131
174 #define KEY_SCROLL_LLOCK 132
175 #define KEYPAD_COMMA 133 // Brazillian (See spec)
176 #define KEYPAD_EQUAL_AS 134 // AS/400 Keyboard (See spec)
177 #define KEY_INTER1 135 // KANJI1 - Brazillian and Japanese "Ru" and "-"
178 #define KEY_INTER2 136 // KANJI2 - Japanese Katakana/Hiragana
179 #define KEY_INTER3 137 // KANJI3 - Japanese Yen
180 #define KEY_INTER4 138 // KANJI4 - Japanese Henkan
181 #define KEY_INTER5 139 // KANJI5 - Japanese Muhenkan
182 #define KEY_INTER6 140 // KANJI6 - PC98 Comma (Ka-m-ma)
183 #define KEY_INTER7 141 // KANJI7 - Double-Byte/Single-Byte Toggle
184 #define KEY_INTER8 142 // KANJI8 - Undefined
185 #define KEY_INTER9 143 // KANJI9 - Undefined
186 #define KEY_LANG1 144 // Korean Hangul/English Toggle
187 #define KEY_LANG2 145 // Korean Hanja Conversion - Japanese Eisu
188 #define KEY_LANG3 146 // Japanese Katakana Key (USB)
189 #define KEY_LANG4 147 // Japanese Hiragana Key (USB)
190 #define KEY_LANG5 148 // Japanese Zenkaku/Hankaku Key (USB)
191 #define KEY_LANG6 149 // Reserved (Application Specific)
192 #define KEY_LANG7 150 // Reserved (Application Specific)
193 #define KEY_LANG8 151 // Reserved (Application Specific)
194 #define KEY_LANG9 152 // Reserved (Application Specific)
195 #define KEY_ALT_ERASE 153 // Special Erase (See Spec)
196 #define KEY_SYSREQ_ATT 154 // Modifier Type
197 #define KEY_CANCEL 155
198 #define KEY_CLEAR 156
199 #define KEY_PRIOR 157
200 #define KEY_RETURN 158
201 #define KEY_SEPARATOR 159
204 #define KEY_CLEAR_AGAIN 162
205 #define KEY_CRSEL_PROPS 163
206 #define KEY_EXSEL 164
207 // 165 - 175 Reserved
208 #define KEYPAD_00 176
209 #define KEYPAD_000 177
210 #define KEY_1000_SEP 178
211 #define KEY_DECIMAL_SEP 179
212 #define KEY_CURRENCY_MAIN 180
213 #define KEY_CURRENCY_SUB 181
214 #define KEYPAD_LPAREN 182
215 #define KEYPAD_RPAREN 183
216 #define KEYPAD_LBRACE 184
217 #define KEYPAD_RBRACE 185
218 #define KEYPAD_TAB 186
219 #define KEYPAD_BACKSPACE 187
226 #define KEYPAD_XOR 194
227 #define KEYPAD_CHEVRON 195
228 #define KEYPAD_PERCENT 196
229 #define KEYPAD_LTHAN 197
230 #define KEYPAD_GTHAN 198
231 #define KEYPAD_AND 199
232 #define KEYPAD_AND_AND 200
233 #define KEYPAD_OR 201
234 #define KEYPAD_OR_OR 202
235 #define KEYPAD_COLON 203
236 #define KEYPAD_POUND 204
237 #define KEYPAD_SPACE 205
238 #define KEYPAD_AT 206
239 #define KEYPAD_EXCLAIM 207
240 #define KEYPAD_MEM_STORE 208
241 #define KEYPAD_MEM_RECALL 209
242 #define KEYPAD_MEM_CLEAR 210
243 #define KEYPAD_MEM_ADD 211
244 #define KEYPAD_MEM_SUB 212
245 #define KEYPAD_MEM_MULT 213
246 #define KEYPAD_MEM_DIV 214
247 #define KEYPAD_PLUS_MINUS 215
248 #define KEYPAD_CLEAR 216
249 #define KEYPAD_CLEAR_ENTRY 217
250 #define KEYPAD_BINARY 218
251 #define KEYPAD_OCTAL 219
252 #define KEYPAD_DECIMAL 220
253 #define KEYPAD_HEX 221
254 // 222 - 223 Reserved
255 #define KEYS_LCTRL 224
256 #define KEYS_LSHIFT 225
257 #define KEYS_LALT 226
258 #define KEYS_LGUI 227
259 #define KEYS_RCTRL 228
260 #define KEYS_RSHIFT 229
261 #define KEYS_RALT 230
262 #define KEYS_RGUI 231
263 // 232 - 65535 Reserved