1 /* $NetBSD: wsksymdef.h,v 1.62 2009/02/18 04:17:44 snj Exp $ */
4 * Copyright (c) 1997 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Juergen Hannken-Illjes.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #ifndef _DEV_WSCONS_WSKSYMDEF_H_
33 #define _DEV_WSCONS_WSKSYMDEF_H_
36 * Keysymbols encoded as 16-bit Unicode. Special symbols
37 * are encoded in the private area (0xe000 - 0xf8ff).
38 * Currently only ISO Latin-1 subset is supported.
40 * This file is parsed from userland. Encode keysyms as:
42 * #define KS_[^ \t]* 0x[0-9a-f]*
44 * and don't modify the border comments.
51 * Group Ascii (ISO Latin1) character in low byte
54 #define KS_BackSpace 0x08
56 #define KS_Linefeed 0x0a
58 #define KS_Return 0x0d
59 #define KS_Escape 0x1b
61 #define KS_exclam 0x21
62 #define KS_quotedbl 0x22
63 #define KS_numbersign 0x23
64 #define KS_dollar 0x24
65 #define KS_percent 0x25
66 #define KS_ampersand 0x26
67 #define KS_apostrophe 0x27
68 #define KS_parenleft 0x28
69 #define KS_parenright 0x29
70 #define KS_asterisk 0x2a
74 #define KS_period 0x2e
87 #define KS_semicolon 0x3b
90 #define KS_greater 0x3e
91 #define KS_question 0x3f
119 #define KS_bracketleft 0x5b
120 #define KS_backslash 0x5c
121 #define KS_bracketright 0x5d
122 #define KS_asciicircum 0x5e
123 #define KS_underscore 0x5f
124 #define KS_grave 0x60
151 #define KS_braceleft 0x7b
153 #define KS_braceright 0x7d
154 #define KS_asciitilde 0x7e
155 #define KS_Delete 0x7f
156 #define KS_nobreakspace 0xa0
157 #define KS_exclamdown 0xa1
159 #define KS_sterling 0xa3
160 #define KS_currency 0xa4
162 #define KS_brokenbar 0xa6
163 #define KS_section 0xa7
164 #define KS_diaeresis 0xa8
165 #define KS_copyright 0xa9
166 #define KS_ordfeminine 0xaa
167 #define KS_guillemotleft 0xab
168 #define KS_notsign 0xac
169 #define KS_hyphen 0xad
170 #define KS_registered 0xae
171 #define KS_macron 0xaf
172 #define KS_degree 0xb0
173 #define KS_plusminus 0xb1
174 #define KS_twosuperior 0xb2
175 #define KS_threesuperior 0xb3
176 #define KS_acute 0xb4
178 #define KS_paragraph 0xb6
179 #define KS_periodcentered 0xb7
180 #define KS_cedilla 0xb8
181 #define KS_onesuperior 0xb9
182 #define KS_masculine 0xba
183 #define KS_guillemotright 0xbb
184 #define KS_onequarter 0xbc
185 #define KS_onehalf 0xbd
186 #define KS_threequarters 0xbe
187 #define KS_questiondown 0xbf
188 #define KS_Agrave 0xc0
189 #define KS_Aacute 0xc1
190 #define KS_Acircumflex 0xc2
191 #define KS_Atilde 0xc3
192 #define KS_Adiaeresis 0xc4
193 #define KS_Aring 0xc5
195 #define KS_Ccedilla 0xc7
196 #define KS_Egrave 0xc8
197 #define KS_Eacute 0xc9
198 #define KS_Ecircumflex 0xca
199 #define KS_Ediaeresis 0xcb
200 #define KS_Igrave 0xcc
201 #define KS_Iacute 0xcd
202 #define KS_Icircumflex 0xce
203 #define KS_Idiaeresis 0xcf
205 #define KS_Ntilde 0xd1
206 #define KS_Ograve 0xd2
207 #define KS_Oacute 0xd3
208 #define KS_Ocircumflex 0xd4
209 #define KS_Otilde 0xd5
210 #define KS_Odiaeresis 0xd6
211 #define KS_multiply 0xd7
212 #define KS_Ooblique 0xd8
213 #define KS_Ugrave 0xd9
214 #define KS_Uacute 0xda
215 #define KS_Ucircumflex 0xdb
216 #define KS_Udiaeresis 0xdc
217 #define KS_Yacute 0xdd
218 #define KS_THORN 0xde
219 #define KS_ssharp 0xdf
220 #define KS_agrave 0xe0
221 #define KS_aacute 0xe1
222 #define KS_acircumflex 0xe2
223 #define KS_atilde 0xe3
224 #define KS_adiaeresis 0xe4
225 #define KS_aring 0xe5
227 #define KS_ccedilla 0xe7
228 #define KS_egrave 0xe8
229 #define KS_eacute 0xe9
230 #define KS_ecircumflex 0xea
231 #define KS_ediaeresis 0xeb
232 #define KS_igrave 0xec
233 #define KS_iacute 0xed
234 #define KS_icircumflex 0xee
235 #define KS_idiaeresis 0xef
237 #define KS_ntilde 0xf1
238 #define KS_ograve 0xf2
239 #define KS_oacute 0xf3
240 #define KS_ocircumflex 0xf4
241 #define KS_otilde 0xf5
242 #define KS_odiaeresis 0xf6
243 #define KS_division 0xf7
244 #define KS_oslash 0xf8
245 #define KS_ugrave 0xf9
246 #define KS_uacute 0xfa
247 #define KS_ucircumflex 0xfb
248 #define KS_udiaeresis 0xfc
249 #define KS_yacute 0xfd
250 #define KS_thorn 0xfe
251 #define KS_ydiaeresis 0xff
252 #define KS_Abreve 0x0102
253 #define KS_abreve 0x0103
254 #define KS_Aogonek 0x0104
255 #define KS_aogonek 0x0105
256 #define KS_Cacute 0x0106
257 #define KS_cacute 0x0107
258 #define KS_Ccaron 0x010c
259 #define KS_ccaron 0x010d
260 #define KS_Dcaron 0x010e
261 #define KS_dcaron 0x010f
262 #define KS_Dstroke 0x0110
263 #define KS_dstroke 0x0111
264 #define KS_Eogonek 0x0118
265 #define KS_eogonek 0x0119
266 #define KS_Ecaron 0x011a
267 #define KS_ecaron 0x011b
268 #define KS_Lacute 0x0139
269 #define KS_lacute 0x013a
270 #define KS_Lcaron 0x013d
271 #define KS_lcaron 0x013e
272 #define KS_Lstroke 0x0141
273 #define KS_lstroke 0x0142
274 #define KS_Nacute 0x0143
275 #define KS_nacute 0x0144
276 #define KS_Ncaron 0x0147
277 #define KS_ncaron 0x0148
278 #define KS_Odoubleacute 0x0150
279 #define KS_odoubleacute 0x0151
280 #define KS_Racute 0x0154
281 #define KS_racute 0x0155
282 #define KS_Rcaron 0x0158
283 #define KS_rcaron 0x0159
284 #define KS_Sacute 0x015a
285 #define KS_sacute 0x015b
286 #define KS_Scedilla 0x015e
287 #define KS_scedilla 0x015f
288 #define KS_Scaron 0x0160
289 #define KS_scaron 0x0161
290 #define KS_Tcedilla 0x0162
291 #define KS_tcedilla 0x0163
292 #define KS_Tcaron 0x0164
293 #define KS_tcaron 0x0165
294 #define KS_Uabovering 0x016e
295 #define KS_uabovering 0x016f
296 #define KS_Udoubleacute 0x0170
297 #define KS_udoubleacute 0x0171
298 #define KS_Zacute 0x0179
299 #define KS_zacute 0x017a
300 #define KS_Zabovedot 0x017b
301 #define KS_zabovedot 0x017c
302 #define KS_Zcaron 0x017d
303 #define KS_zcaron 0x017e
305 #define KS_caron 0x02c7
306 #define KS_breve 0x02d8
307 #define KS_abovedot 0x02d9
308 #define KS_ogonek 0x02db
309 #define KS_doubleacute 0x02dd
312 * Group Dead (dead accents)
313 * http://www.unicode.org/charts/PDF/U0300.pdf
314 * dotaccent = "dot above"
315 * hungarumlaut = "double acute"
316 * slash = "short solidus"
319 #define KS_dead_grave 0x0300
320 #define KS_dead_acute 0x0301
321 #define KS_dead_circumflex 0x0302
322 #define KS_dead_tilde 0x0303
323 #define KS_dead_breve 0x0306
324 #define KS_dead_diaeresis 0x0308
325 #define KS_dead_abovering 0x030a
326 #define KS_dead_caron 0x030c
327 #define KS_dead_dotaccent 0x0307
328 #define KS_dead_hungarumlaut 0x030b
329 #define KS_dead_ogonek 0x0328
330 #define KS_dead_slash 0x0337
331 #define KS_dead_cedilla 0x0327
332 #define KS_dead_semi 0x0328
333 #define KS_dead_colon 0x0329
339 #define KS_gr_At 0xb6
340 #define KS_gr_Et 0xb8
341 #define KS_gr_Ht 0xb9
342 #define KS_gr_It 0xba
343 #define KS_gr_Ot 0xbc
344 #define KS_gr_Yt 0xbe
345 #define KS_gr_Vt 0xbf
346 #define KS_gr_itd 0xc0
371 #define KS_gr_Id 0xda
372 #define KS_gr_Yd 0xdb
373 #define KS_gr_at 0xdc
374 #define KS_gr_et 0xdd
375 #define KS_gr_ht 0xde
376 #define KS_gr_it 0xdf
377 #define KS_gr_ytd 0xe0
395 #define KS_gr_teliko_s 0xf2
403 #define KS_gr_id 0xfa
404 #define KS_gr_yd 0xfb
405 #define KS_gr_ot 0xfc
406 #define KS_gr_yt 0xfd
407 #define KS_gr_vt 0xfe
410 * Group 1 (modifiers)
413 #define KS_Shift_L 0xf101
414 #define KS_Shift_R 0xf102
415 #define KS_Control_L 0xf103
416 #define KS_Control_R 0xf104
417 #define KS_Caps_Lock 0xf105
418 #define KS_Shift_Lock 0xf106
419 #define KS_Alt_L 0xf107
420 #define KS_Alt_R 0xf108
421 #define KS_Multi_key 0xf109
422 #define KS_Mode_switch 0xf10a
423 #define KS_Num_Lock 0xf10b
424 #define KS_Hold_Screen 0xf10c
425 #define KS_Cmd 0xf10d
426 #define KS_Cmd1 0xf10e
427 #define KS_Cmd2 0xf10f
428 #define KS_Meta_L 0xf110
429 #define KS_Meta_R 0xf111
430 #define KS_Zenkaku_Hankaku 0xf112 /* Zenkaku/Hankaku toggle */
431 #define KS_Hiragana_Katakana 0xf113 /* Hiragana/Katakana toggle */
432 #define KS_Henkan_Mode 0xf114 /* Start/Stop Conversion */
433 #define KS_Henkan 0xf115 /* Alias for Henkan_Mode */
434 #define KS_Muhenkan 0xf116 /* Cancel Conversion */
437 * Group 2 (keypad) character in low byte
440 #define KS_KP_F1 0xf291
441 #define KS_KP_F2 0xf292
442 #define KS_KP_F3 0xf293
443 #define KS_KP_F4 0xf294
444 #define KS_KP_Home 0xf295
445 #define KS_KP_Left 0xf296
446 #define KS_KP_Up 0xf297
447 #define KS_KP_Right 0xf298
448 #define KS_KP_Down 0xf299
449 #define KS_KP_Prior 0xf29a
450 #define KS_KP_Next 0xf29b
451 #define KS_KP_End 0xf29c
452 #define KS_KP_Begin 0xf29d
453 #define KS_KP_Insert 0xf29e
454 #define KS_KP_Delete 0xf29f
456 #define KS_KP_Space 0xf220
457 #define KS_KP_Tab 0xf209
458 #define KS_KP_Enter 0xf20d
459 #define KS_KP_Equal 0xf23d
460 #define KS_KP_Numbersign 0xf223
461 #define KS_KP_Multiply 0xf22a
462 #define KS_KP_Add 0xf22b
463 #define KS_KP_Separator 0xf22c
464 #define KS_KP_Subtract 0xf22d
465 #define KS_KP_Decimal 0xf22e
466 #define KS_KP_Divide 0xf22f
467 #define KS_KP_0 0xf230
468 #define KS_KP_1 0xf231
469 #define KS_KP_2 0xf232
470 #define KS_KP_3 0xf233
471 #define KS_KP_4 0xf234
472 #define KS_KP_5 0xf235
473 #define KS_KP_6 0xf236
474 #define KS_KP_7 0xf237
475 #define KS_KP_8 0xf238
476 #define KS_KP_9 0xf239
491 #define KS_f10 0xf309
492 #define KS_f11 0xf30a
493 #define KS_f12 0xf30b
494 #define KS_f13 0xf30c
495 #define KS_f14 0xf30d
496 #define KS_f15 0xf30e
497 #define KS_f16 0xf30f
498 #define KS_f17 0xf310
499 #define KS_f18 0xf311
500 #define KS_f19 0xf312
501 #define KS_f20 0xf313
512 #define KS_F10 0xf349
513 #define KS_F11 0xf34a
514 #define KS_F12 0xf34b
515 #define KS_F13 0xf34c
516 #define KS_F14 0xf34d
517 #define KS_F15 0xf34e
518 #define KS_F16 0xf34f
519 #define KS_F17 0xf350
520 #define KS_F18 0xf351
521 #define KS_F19 0xf352
522 #define KS_F20 0xf353
524 #define KS_Power 0xf36d
526 #define KS_Home 0xf381
527 #define KS_Prior 0xf382
528 #define KS_Next 0xf383
530 #define KS_Down 0xf385
531 #define KS_Left 0xf386
532 #define KS_Right 0xf387
533 #define KS_End 0xf388
534 #define KS_Insert 0xf389
535 #define KS_Help 0xf38a
536 #define KS_Execute 0xf38b
537 #define KS_Find 0xf38c
538 #define KS_Select 0xf38d
539 #define KS_Again 0xf38e
540 #define KS_Props 0xf38f
541 #define KS_Undo 0xf390
542 #define KS_Front 0xf391
543 #define KS_Copy 0xf392
544 #define KS_Open 0xf393
545 #define KS_Paste 0xf394
546 #define KS_Cut 0xf395
548 #define KS_Menu 0xf3c0
549 #define KS_Pause 0xf3c1
550 #define KS_Print_Screen 0xf3c2
556 #define KS_Cmd_Screen0 0xf400
557 #define KS_Cmd_Screen1 0xf401
558 #define KS_Cmd_Screen2 0xf402
559 #define KS_Cmd_Screen3 0xf403
560 #define KS_Cmd_Screen4 0xf404
561 #define KS_Cmd_Screen5 0xf405
562 #define KS_Cmd_Screen6 0xf406
563 #define KS_Cmd_Screen7 0xf407
564 #define KS_Cmd_Screen8 0xf408
565 #define KS_Cmd_Screen9 0xf409
566 #define KS_Cmd_Debugger 0xf420
567 #define KS_Cmd_ResetEmul 0xf421
568 #define KS_Cmd_ResetClose 0xf422
569 #define KS_Cmd_BacklightOn 0xf423
570 #define KS_Cmd_BacklightOff 0xf424
571 #define KS_Cmd_BacklightToggle 0xf425
572 #define KS_Cmd_BrightnessUp 0xf426
573 #define KS_Cmd_BrightnessDown 0xf427
574 #define KS_Cmd_BrightnessRotate 0xf428
575 #define KS_Cmd_ContrastUp 0xf429
576 #define KS_Cmd_ContrastDown 0xf42a
577 #define KS_Cmd_ContrastRotate 0xf42b
578 #define KS_Cmd_ScrollFastUp 0xf42c
579 #define KS_Cmd_ScrollFastDown 0xf42d
580 #define KS_Cmd_ScrollSlowUp 0xf42e
581 #define KS_Cmd_ScrollSlowDown 0xf42f
582 #define KS_Cmd_VolumeUp 0xf430
583 #define KS_Cmd_VolumeDown 0xf431
584 #define KS_Cmd_VolumeToggle 0xf432
590 #define KS_voidSymbol 0xf500
598 #define KS_GROUP_Mod 0xf100U
599 #define KS_GROUP_Keypad 0xf200U
600 #define KS_GROUP_Function 0xf300U
601 #define KS_GROUP_Command 0xf400U
602 #define KS_GROUP_Internal 0xf500U
603 #define KS_GROUP_Dead 0xf801U /* not encoded in keysym */
604 #define KS_GROUP_Ascii 0xf802U /* not encoded in keysym */
605 #define KS_GROUP_Keycode 0xf803U /* not encoded in keysym */
607 #define KS_NUMKEYCODES 0x1000
608 #define KS_KEYCODE(v) ((v) | 0xe000)
610 #define KS_GROUP(k) ((k) >= 0x0300 && (k) < 0x0370 ? KS_GROUP_Dead : \
611 (((k) & 0xf000) == 0xe000 ? KS_GROUP_Keycode : \
612 (((k) & 0xf800) == 0xf000 ? ((k) & 0xff00) : \
615 #define KS_VALUE(k) (((k) & 0xf000) == 0xe000 ? ((k) & 0x0fff) : \
616 (((k) & 0xf800) == 0xf000 ? ((k) & 0x00ff) : (k)))
619 * Keyboard types: 8bit encoding, 24bit variant
622 #define KB_ENCODING(e) ((e) & 0x0000ff00)
623 #define KB_VARIANT(e) ((e) & 0xffff00ff)
625 #define KB_NODEAD 0x0001
626 #define KB_DECLK 0x0002 /* DEC LKnnn layout */
627 #define KB_LK401 0x0004 /* DEC LK401 instead LK201 */
628 #define KB_SWAPCTRLCAPS 0x0008 /* Swap Left-Control and Caps-Lock */
629 #define KB_DVORAK 0x0010 /* Dvorak layout */
630 #define KB_METAESC 0x0020 /* generate ESC prefix on ALT-key */
631 #define KB_IOPENER 0x0040 /* f1-f12 -> ESC,f1-f11 */
632 #define KB_MACHDEP 0x0080 /* machine dependent */
633 #define KB_COLEMAK 0x00010000 /* Colemak layout */
636 * Define keyboard type and texts all in one table.
637 * Include default variants (and their text form) for sysinst.
638 * Sort (loosely) by country name.
640 #define KB_ENC_FUN(action) \
641 action(KB_USER, 0, 0x0100, "user", , "User-defined") \
642 action(KB_US, 0, 0x0200, "us", , "US-English") \
643 action(KB_UK, 0, 0x0700, "uk", , "UK-English") \
644 action(KB_BE, 0, 0x1300, "be", , "Belgian") \
645 action(KB_CZ, 0, 0x1500, "cz", , "Czech") \
646 action(KB_DK, 0, 0x0400, "dk", , "Danish") \
647 action(KB_FI, 0, 0x0900, "fi", , "Finnish") \
648 action(KB_FR, 0, 0x0600, "fr", , "French") \
649 action(KB_DE, KB_NODEAD,0x0300, "de",".nodead", "German") \
650 action(KB_GR, 0, 0x1400, "gr", , "Greek") \
651 action(KB_HU, 0, 0x0c00, "hu", , "Hungarian") \
652 action(KB_IT, 0, 0x0500, "it", , "Italian") \
653 action(KB_JP, 0, 0x0800, "jp", , "Japanese") \
654 action(KB_NO, 0, 0x0a00, "no", , "Norwegian") \
655 action(KB_PL, 0, 0x0d00, "pl", , "Polish") \
656 action(KB_PT, 0, 0x1100, "pt", , "Portuguese") \
657 action(KB_RU, 0, 0x0e00, "ru", , "Russian") \
658 action(KB_ES, 0, 0x0b00, "es", , "Spanish") \
659 action(KB_SV, 0, 0x0900, "sv", , "Swedish") \
660 action(KB_SF, 0, 0x1000, "sf", , "Swiss French") \
661 action(KB_SG, 0, 0x0f00, "sg", , "Swiss German") \
662 action(KB_UA, 0, 0x1200, "ua", , "Ukrainian")
663 #define KB_NONE 0x0000
665 /* Define all the KB_xx numeric values using above table */
666 #define KBF_ENUM(tag, tagf, value, cc, ccf, country) tag=value,
667 enum { KB_ENC_FUN(KBF_ENUM
) KB_NEXT
=0x1600 };
669 /* Define list of KB_xxx and country codes for array initialisation */
670 #define KBF_ENCTAB(tag, tagf, value, cc, ccf, country) { tag, cc },
671 #define KB_ENCTAB KB_ENC_FUN(KBF_ENCTAB)
674 { KB_NODEAD, "nodead" }, \
675 { KB_DECLK, "declk" }, \
676 { KB_LK401, "lk401" }, \
677 { KB_SWAPCTRLCAPS, "swapctrlcaps" }, \
678 { KB_DVORAK, "dvorak" }, \
679 { KB_METAESC, "metaesc" }, \
680 { KB_IOPENER, "iopener" }, \
681 { KB_MACHDEP, "machdep" }, \
682 { KB_COLEMAK, "colemak" }
684 #endif /* !_DEV_WSCONS_WSKSYMDEF_H_ */