wsksymdef.h revision 1.13
1234285Sdim/*	$NetBSD: wsksymdef.h,v 1.13 1998/12/28 13:48:24 hannken Exp $ */
2234285Sdim
3234285Sdim/*-
4234285Sdim * Copyright (c) 1997 The NetBSD Foundation, Inc.
5234285Sdim * All rights reserved.
6234285Sdim *
7234285Sdim * This code is derived from software contributed to The NetBSD Foundation
8234285Sdim * by Juergen Hannken-Illjes.
9234285Sdim *
10234285Sdim * Redistribution and use in source and binary forms, with or without
11234285Sdim * modification, are permitted provided that the following conditions
12234285Sdim * are met:
13234285Sdim * 1. Redistributions of source code must retain the above copyright
14234285Sdim *    notice, this list of conditions and the following disclaimer.
15234285Sdim * 2. Redistributions in binary form must reproduce the above copyright
16234285Sdim *    notice, this list of conditions and the following disclaimer in the
17280031Sdim *    documentation and/or other materials provided with the distribution.
18280031Sdim * 3. All advertising materials mentioning features or use of this software
19234285Sdim *    must display the following acknowledgement:
20249423Sdim *	This product includes software developed by the NetBSD
21249423Sdim *	Foundation, Inc. and its contributors.
22280031Sdim * 4. Neither the name of The NetBSD Foundation nor the names of its
23249423Sdim *    contributors may be used to endorse or promote products derived
24234285Sdim *    from this software without specific prior written permission.
25234285Sdim *
26234285Sdim * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27234285Sdim * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28234285Sdim * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29234285Sdim * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30234285Sdim * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31234285Sdim * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32239462Sdim * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33239462Sdim * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34239462Sdim * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35249423Sdim * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36249423Sdim * POSSIBILITY OF SUCH DAMAGE.
37249423Sdim */
38249423Sdim
39249423Sdim#ifndef _DEV_WSCONS_WSKSYMDEF_H_
40249423Sdim#define _DEV_WSCONS_WSKSYMDEF_H_
41249423Sdim
42249423Sdim/*
43249423Sdim * Keysymbols encoded as 16-bit Unicode. Special symbols
44249423Sdim * are encoded in the private area (0xe000 - 0xf8ff).
45249423Sdim * Currently only ISO Latin-1 subset is supported.
46288943Sdim *
47296417Sdim * This file is parsed from userland. Encode keysyms as:
48296417Sdim *
49296417Sdim *	#define KS_[^ \t]* 0x[0-9a-f]*
50296417Sdim *
51296417Sdim * and don't modify the border comments.
52296417Sdim */
53296417Sdim
54296417Sdim
55296417Sdim/*BEGINKEYSYMDECL*/
56296417Sdim
57296417Sdim/*
58296417Sdim * Group Ascii (ISO Latin1) character in low byte
59296417Sdim */
60296417Sdim
61296417Sdim#define	KS_BackSpace 		0x08
62296417Sdim#define	KS_Tab 			0x09
63296417Sdim#define	KS_Linefeed 		0x0a
64296417Sdim#define	KS_Clear 		0x0b
65296417Sdim#define	KS_Return 		0x0d
66249423Sdim#define	KS_Escape 		0x1b
67249423Sdim#define	KS_space 		0x20
68239462Sdim#define	KS_exclam 		0x21
69239462Sdim#define	KS_quotedbl 		0x22
70249423Sdim#define	KS_numbersign 		0x23
71249423Sdim#define	KS_dollar 		0x24
72249423Sdim#define	KS_percent 		0x25
73249423Sdim#define	KS_ampersand 		0x26
74249423Sdim#define	KS_apostrophe 		0x27
75249423Sdim#define	KS_parenleft 		0x28
76249423Sdim#define	KS_parenright 		0x29
77249423Sdim#define	KS_asterisk 		0x2a
78249423Sdim#define	KS_plus 		0x2b
79249423Sdim#define	KS_comma 		0x2c
80249423Sdim#define	KS_minus 		0x2d
81249423Sdim#define	KS_period 		0x2e
82239462Sdim#define	KS_slash 		0x2f
83249423Sdim#define	KS_0 			0x30
84249423Sdim#define	KS_1 			0x31
85249423Sdim#define	KS_2 			0x32
86249423Sdim#define	KS_3 			0x33
87249423Sdim#define	KS_4 			0x34
88249423Sdim#define	KS_5 			0x35
89261991Sdim#define	KS_6 			0x36
90261991Sdim#define	KS_7 			0x37
91249423Sdim#define	KS_8 			0x38
92239462Sdim#define	KS_9 			0x39
93296417Sdim#define	KS_colon 		0x3a
94288943Sdim#define	KS_semicolon 		0x3b
95249423Sdim#define	KS_less 		0x3c
96249423Sdim#define	KS_equal 		0x3d
97249423Sdim#define	KS_greater 		0x3e
98261991Sdim#define	KS_question 		0x3f
99296417Sdim#define	KS_at 			0x40
100296417Sdim#define	KS_A 			0x41
101296417Sdim#define	KS_B 			0x42
102296417Sdim#define	KS_C 			0x43
103249423Sdim#define	KS_D 			0x44
104249423Sdim#define	KS_E 			0x45
105234285Sdim#define	KS_F 			0x46
106239462Sdim#define	KS_G 			0x47
107234285Sdim#define	KS_H 			0x48
108239462Sdim#define	KS_I 			0x49
109239462Sdim#define	KS_J 			0x4a
110239462Sdim#define	KS_K 			0x4b
111234285Sdim#define	KS_L 			0x4c
112239462Sdim#define	KS_M 			0x4d
113239462Sdim#define	KS_N 			0x4e
114239462Sdim#define	KS_O 			0x4f
115276479Sdim#define	KS_P 			0x50
116276479Sdim#define	KS_Q 			0x51
117276479Sdim#define	KS_R 			0x52
118276479Sdim#define	KS_S 			0x53
119276479Sdim#define	KS_T 			0x54
120276479Sdim#define	KS_U 			0x55
121239462Sdim#define	KS_V 			0x56
122234285Sdim#define	KS_W 			0x57
123276479Sdim#define	KS_X 			0x58
124249423Sdim#define	KS_Y 			0x59
125276479Sdim#define	KS_Z 			0x5a
126249423Sdim#define	KS_bracketleft 		0x5b
127276479Sdim#define	KS_backslash 		0x5c
128249423Sdim#define	KS_bracketright 	0x5d
129276479Sdim#define	KS_asciicircum 		0x5e
130276479Sdim#define	KS_underscore 		0x5f
131249423Sdim#define	KS_grave 		0x60
132249423Sdim#define	KS_a 			0x61
133276479Sdim#define	KS_b 			0x62
134249423Sdim#define	KS_c 			0x63
135249423Sdim#define	KS_d 			0x64
136276479Sdim#define	KS_e 			0x65
137249423Sdim#define	KS_f 			0x66
138249423Sdim#define	KS_g 			0x67
139276479Sdim#define	KS_h 			0x68
140249423Sdim#define	KS_i 			0x69
141249423Sdim#define	KS_j 			0x6a
142276479Sdim#define	KS_k 			0x6b
143249423Sdim#define	KS_l 			0x6c
144249423Sdim#define	KS_m 			0x6d
145276479Sdim#define	KS_n 			0x6e
146249423Sdim#define	KS_o 			0x6f
147276479Sdim#define	KS_p 			0x70
148276479Sdim#define	KS_q 			0x71
149276479Sdim#define	KS_r 			0x72
150276479Sdim#define	KS_s 			0x73
151276479Sdim#define	KS_t 			0x74
152276479Sdim#define	KS_u 			0x75
153249423Sdim#define	KS_v 			0x76
154249423Sdim#define	KS_w 			0x77
155276479Sdim#define	KS_x 			0x78
156249423Sdim#define	KS_y 			0x79
157249423Sdim#define	KS_z 			0x7a
158276479Sdim#define	KS_braceleft 		0x7b
159249423Sdim#define	KS_bar 			0x7c
160249423Sdim#define	KS_braceright 		0x7d
161276479Sdim#define	KS_asciitilde 		0x7e
162249423Sdim#define	KS_Delete 		0x7f
163249423Sdim
164276479Sdim#define	KS_nobreakspace 	0xa0
165249423Sdim#define	KS_exclamdown 		0xa1
166249423Sdim#define	KS_cent 		0xa2
167276479Sdim#define	KS_sterling 		0xa3
168249423Sdim#define	KS_currency 		0xa4
169276479Sdim#define	KS_yen 			0xa5
170276479Sdim#define	KS_brokenbar 		0xa6
171276479Sdim#define	KS_section 		0xa7
172249423Sdim#define	KS_diaeresis 		0xa8
173249423Sdim#define	KS_copyright 		0xa9
174276479Sdim#define	KS_ordfeminine 		0xaa
175249423Sdim#define	KS_guillemotleft 	0xab
176249423Sdim#define	KS_notsign 		0xac
177249423Sdim#define	KS_hyphen 		0xad
178276479Sdim#define	KS_registered 		0xae
179249423Sdim#define	KS_macron 		0xaf
180276479Sdim#define	KS_degree 		0xb0
181276479Sdim#define	KS_plusminus 		0xb1
182296417Sdim#define	KS_twosuperior 		0xb2
183249423Sdim#define	KS_threesuperior 	0xb3
184276479Sdim#define	KS_acute 		0xb4
185276479Sdim#define	KS_mu 			0xb5
186276479Sdim#define	KS_paragraph 		0xb6
187276479Sdim#define	KS_periodcentered 	0xb7
188276479Sdim#define	KS_cedilla 		0xb8
189276479Sdim#define	KS_onesuperior 		0xb9
190296417Sdim#define	KS_masculine 		0xba
191296417Sdim#define	KS_guillemotright 	0xbb
192296417Sdim#define	KS_onequarter 		0xbc
193296417Sdim#define	KS_onehalf 		0xbd
194296417Sdim#define	KS_threequarters 	0xbe
195296417Sdim#define	KS_questiondown 	0xbf
196296417Sdim#define	KS_Agrave 		0xc0
197296417Sdim#define	KS_Aacute 		0xc1
198296417Sdim#define	KS_Acircumflex 		0xc2
199296417Sdim#define	KS_Atilde 		0xc3
200296417Sdim#define	KS_Adiaeresis 		0xc4
201296417Sdim#define	KS_Aring 		0xc5
202296417Sdim#define	KS_AE 			0xc6
203296417Sdim#define	KS_Ccedilla 		0xc7
204296417Sdim#define	KS_Egrave 		0xc8
205296417Sdim#define	KS_Eacute 		0xc9
206296417Sdim#define	KS_Ecircumflex 		0xca
207234285Sdim#define	KS_Ediaeresis 		0xcb
208234285Sdim#define	KS_Igrave 		0xcc
209234285Sdim#define	KS_Iacute 		0xcd
210234285Sdim#define	KS_Icircumflex 		0xce
211249423Sdim#define	KS_Idiaeresis 		0xcf
212249423Sdim#define	KS_ETH 			0xd0
213249423Sdim#define	KS_Ntilde 		0xd1
214249423Sdim#define	KS_Ograve 		0xd2
215249423Sdim#define	KS_Oacute 		0xd3
216249423Sdim#define	KS_Ocircumflex 		0xd4
217249423Sdim#define	KS_Otilde 		0xd5
218249423Sdim#define	KS_Odiaeresis 		0xd6
219249423Sdim#define	KS_multiply 		0xd7
220249423Sdim#define	KS_Ooblique 		0xd8
221249423Sdim#define	KS_Ugrave 		0xd9
222249423Sdim#define	KS_Uacute 		0xda
223249423Sdim#define	KS_Ucircumflex 		0xdb
224249423Sdim#define	KS_Udiaeresis 		0xdc
225249423Sdim#define	KS_Yacute 		0xdd
226249423Sdim#define	KS_THORN 		0xde
227249423Sdim#define	KS_ssharp 		0xdf
228249423Sdim#define	KS_agrave 		0xe0
229249423Sdim#define	KS_aacute 		0xe1
230249423Sdim#define	KS_acircumflex 		0xe2
231249423Sdim#define	KS_atilde 		0xe3
232249423Sdim#define	KS_adiaeresis 		0xe4
233288943Sdim#define	KS_aring 		0xe5
234288943Sdim#define	KS_ae 			0xe6
235288943Sdim#define	KS_ccedilla 		0xe7
236288943Sdim#define	KS_egrave 		0xe8
237288943Sdim#define	KS_eacute 		0xe9
238288943Sdim#define	KS_ecircumflex 		0xea
239288943Sdim#define	KS_ediaeresis 		0xeb
240288943Sdim#define	KS_igrave 		0xec
241288943Sdim#define	KS_iacute 		0xed
242288943Sdim#define	KS_icircumflex 		0xee
243288943Sdim#define	KS_idiaeresis 		0xef
244288943Sdim#define	KS_eth 			0xf0
245288943Sdim#define	KS_ntilde 		0xf1
246288943Sdim#define	KS_ograve 		0xf2
247288943Sdim#define	KS_oacute 		0xf3
248288943Sdim#define	KS_ocircumflex 		0xf4
249288943Sdim#define	KS_otilde 		0xf5
250288943Sdim#define	KS_odiaeresis 		0xf6
251288943Sdim#define	KS_division 		0xf7
252288943Sdim#define	KS_oslash 		0xf8
253280031Sdim#define	KS_ugrave 		0xf9
254280031Sdim#define	KS_uacute 		0xfa
255280031Sdim#define	KS_ucircumflex 		0xfb
256280031Sdim#define	KS_udiaeresis 		0xfc
257280031Sdim#define	KS_yacute 		0xfd
258280031Sdim#define	KS_thorn 		0xfe
259280031Sdim#define	KS_ydiaeresis 		0xff
260280031Sdim
261296417Sdim/*
262296417Sdim * Group Dead (dead accents)
263296417Sdim */
264296417Sdim
265296417Sdim#define	KS_dead_grave 		0x0300
266296417Sdim#define	KS_dead_acute 		0x0301
267296417Sdim#define	KS_dead_circumflex 	0x0302
268296417Sdim#define	KS_dead_tilde 		0x0303
269296417Sdim#define	KS_dead_diaeresis 	0x0308
270296417Sdim#define	KS_dead_abovering 	0x030a
271296417Sdim#define	KS_dead_cedilla 	0x0327
272296417Sdim
273296417Sdim/*
274296417Sdim * Group 1 (modifiers)
275296417Sdim */
276296417Sdim
277296417Sdim#define	KS_Shift_L 		0xf101
278296417Sdim#define	KS_Shift_R 		0xf102
279296417Sdim#define	KS_Control_L 		0xf103
280296417Sdim#define	KS_Control_R 		0xf104
281234285Sdim#define	KS_Caps_Lock 		0xf105
282234285Sdim#define	KS_Shift_Lock 		0xf106
283234285Sdim#define	KS_Alt_L 		0xf107
284234285Sdim#define	KS_Alt_R 		0xf108
285234285Sdim#define	KS_Multi_key 		0xf109
286#define	KS_Mode_switch 		0xf10a
287#define	KS_Num_Lock 		0xf10b
288#define KS_Hold_Screen		0xf10c
289#define KS_Cmd			0xf10d
290#define KS_Cmd1			0xf10e
291#define KS_Cmd2			0xf10f
292
293/*
294 * Group 2 (keypad) character in low byte
295 */
296
297#define	KS_KP_F1 		0xf291
298#define	KS_KP_F2 		0xf292
299#define	KS_KP_F3 		0xf293
300#define	KS_KP_F4 		0xf294
301#define	KS_KP_Home 		0xf295
302#define	KS_KP_Left 		0xf296
303#define	KS_KP_Up 		0xf297
304#define	KS_KP_Right 		0xf298
305#define	KS_KP_Down 		0xf299
306#define	KS_KP_Prior 		0xf29a
307#define	KS_KP_Next 		0xf29b
308#define	KS_KP_End 		0xf29c
309#define	KS_KP_Begin 		0xf29d
310#define	KS_KP_Insert 		0xf29e
311#define	KS_KP_Delete 		0xf29f
312
313#define	KS_KP_Space 		0xf220
314#define	KS_KP_Tab 		0xf209
315#define	KS_KP_Enter 		0xf20d
316#define	KS_KP_Equal 		0xf23d
317#define	KS_KP_Multiply 		0xf22a
318#define	KS_KP_Add 		0xf22b
319#define	KS_KP_Separator 	0xf22c
320#define	KS_KP_Subtract 		0xf22d
321#define	KS_KP_Decimal 		0xf22e
322#define	KS_KP_Divide 		0xf22f
323#define	KS_KP_0 		0xf230
324#define	KS_KP_1 		0xf231
325#define	KS_KP_2 		0xf232
326#define	KS_KP_3 		0xf233
327#define	KS_KP_4 		0xf234
328#define	KS_KP_5 		0xf235
329#define	KS_KP_6 		0xf236
330#define	KS_KP_7 		0xf237
331#define	KS_KP_8 		0xf238
332#define	KS_KP_9 		0xf239
333
334/*
335 * Group 3 (function)
336 */
337
338#define KS_f1			0xf300
339#define KS_f2			0xf301
340#define KS_f3			0xf302
341#define KS_f4			0xf303
342#define KS_f5			0xf304
343#define KS_f6			0xf305
344#define KS_f7			0xf306
345#define KS_f8			0xf307
346#define KS_f9			0xf308
347#define KS_f10			0xf309
348#define KS_f11			0xf30a
349#define KS_f12			0xf30b
350#define KS_f13			0xf30c
351#define KS_f14			0xf30d
352#define KS_f15			0xf30e
353#define KS_f16			0xf30f
354#define KS_f17			0xf310
355#define KS_f18			0xf311
356#define KS_f19			0xf312
357#define KS_f20			0xf313
358
359#define KS_F1			0xf340
360#define KS_F2			0xf341
361#define KS_F3			0xf342
362#define KS_F4			0xf343
363#define KS_F5			0xf344
364#define KS_F6			0xf345
365#define KS_F7			0xf346
366#define KS_F8			0xf347
367#define KS_F9			0xf348
368#define KS_F10			0xf349
369#define KS_F11			0xf34a
370#define KS_F12			0xf34b
371#define KS_F13			0xf34c
372#define KS_F14			0xf34d
373#define KS_F15			0xf34e
374#define KS_F16			0xf34f
375#define KS_F17			0xf350
376#define KS_F18			0xf351
377#define KS_F19			0xf352
378#define KS_F20			0xf353
379
380#define KS_Home			0xf381
381#define KS_Prior		0xf382
382#define KS_Next			0xf383
383#define KS_Up			0xf384
384#define KS_Down			0xf385
385#define KS_Left			0xf386
386#define KS_Right		0xf387
387#define KS_End			0xf388
388#define KS_Insert		0xf389
389#define KS_Help			0xf38a
390#define KS_Execute		0xf38b
391#define KS_Find			0xf38c
392#define KS_Select		0xf38d
393
394/*
395 * Group 4 (command)
396 */
397
398#define KS_Cmd_Screen0		0xf400
399#define KS_Cmd_Screen1		0xf401
400#define KS_Cmd_Screen2		0xf402
401#define KS_Cmd_Screen3		0xf403
402#define KS_Cmd_Screen4		0xf404
403#define KS_Cmd_Screen5		0xf405
404#define KS_Cmd_Screen6		0xf406
405#define KS_Cmd_Screen7		0xf407
406#define KS_Cmd_Screen8		0xf408
407#define KS_Cmd_Screen9		0xf409
408#define KS_Cmd_Debugger		0xf420
409
410/*
411 * Group 5 (internal)
412 */
413
414#define KS_voidSymbol		0xf500
415
416/*ENDKEYSYMDECL*/
417
418/*
419 * keysym groups
420 */
421
422#define KS_GROUP_Mod		0xf100
423#define KS_GROUP_Keypad		0xf200
424#define KS_GROUP_Function	0xf300
425#define KS_GROUP_Command	0xf400
426#define KS_GROUP_Internal	0xf500
427#define KS_GROUP_Dead		0xf801		/* not encoded in keysym */
428#define KS_GROUP_Ascii		0xf802		/* not encoded in keysym */
429#define KS_GROUP_Keycode	0xf803		/* not encoded in keysym */
430
431#define KS_NUMKEYCODES	0x1000
432#define KS_KEYCODE(v)	((v) | 0xe000)
433
434#define KS_GROUP(k)	((k) >= 0x0300 && (k) < 0x0370 ? KS_GROUP_Dead : \
435			    (((k) & 0xf000) == 0xe000 ? KS_GROUP_Keycode : \
436			      (((k) & 0xf800) == 0xf000 ? ((k) & 0xff00) : \
437				KS_GROUP_Ascii)))
438
439#define KS_VALUE(k)	(((k) & 0xf000) == 0xe000 ? ((k) & 0x0fff) : \
440			    (((k) & 0xf800) == 0xf000 ? ((k) & 0x00ff) : (k)))
441
442/*
443 * Keyboard types: 8bit encoding, 8bit variant
444 */
445
446#define KB_ENCODING(e)		((e) & 0xff00)
447#define KB_VARIANT(e)		((e) & 0x00ff)
448
449#define KB_USER			0x0100
450#define KB_US			0x0200
451#define KB_DE			0x0300
452#define KB_DK			0x0400
453#define KB_IT			0x0500
454#define KB_FR                   0x0600
455
456#define KB_NODEAD		0x0001
457#define KB_DECLK		0x0002	/* DEC LKnnn layout */
458#define KB_LK401		0x0004	/* DEC LK401 instead LK201 */
459
460#define KB_NAMETAB \
461	{ KB_USER,	"user" }, \
462	{ KB_US,	"us" }, \
463	{ KB_DE,	"de" }, \
464	{ KB_DK,	"dk" }, \
465	{ KB_IT,	"it" }, \
466	{ KB_FR,	"fr" }, \
467	{ KB_NODEAD,	"nodead" }, \
468	{ KB_DECLK,	"declk" }, \
469	{ KB_LK401,	"lk401" }
470
471#endif /* !_DEV_WSCONS_WSKSYMDEF_H_ */
472