bsd_KbdMap.c revision f5a99ab6
1ee3138f1Smrg/*
2ee3138f1Smrg * Slightly modified xf86KbdBSD.c which is
3ee3138f1Smrg *
4ee3138f1Smrg * Derived from xf86Kbd.c by S_ren Schmidt (sos@login.dkuug.dk)
5ee3138f1Smrg * which is Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
6ee3138f1Smrg * and from xf86KbdCODrv.c by Holger Veit
7ee3138f1Smrg */
8ee3138f1Smrg
9ee3138f1Smrg#ifdef HAVE_CONFIG_H
10ee3138f1Smrg#include "config.h"
11ee3138f1Smrg#endif
12ee3138f1Smrg
13632d17a8Smrg#include <xorg-server.h>
14ee3138f1Smrg#include <X11/X.h>
15ee3138f1Smrg#include <X11/Xmd.h>
16ee3138f1Smrg#include "input.h"
17ee3138f1Smrg#include "scrnintstr.h"
18ee3138f1Smrg
19ee3138f1Smrg#include "compiler.h"
20ee3138f1Smrg
21ee3138f1Smrg#include "xf86.h"
22ee3138f1Smrg#include "xf86Priv.h"
23ee3138f1Smrg#include "xf86_OSlib.h"
24ee3138f1Smrg#include "xf86Xinput.h"
25ee3138f1Smrg#include "xf86OSKbd.h"
26ee3138f1Smrg#include "atKeynames.h"
27ee3138f1Smrg#include "xf86Keymap.h"
28ee3138f1Smrg#include "bsd_kbd.h"
29ee3138f1Smrg
30ee3138f1Smrg#if (defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT)) && defined(GIO_KEYMAP)
31ee3138f1Smrg#define KD_GET_ENTRY(i,n) \
32ee3138f1Smrg  eascii_to_x[((keymap.key[i].spcl << (n+1)) & 0x100) + keymap.key[i].map[n]]
33ee3138f1Smrg
34ee3138f1Smrgstatic unsigned char remap[NUM_KEYCODES] = {
35ee3138f1Smrg     0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,   /* 0x00 - 0x07 */
36ee3138f1Smrg  0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,   /* 0x08 - 0x0f */
37ee3138f1Smrg  0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,   /* 0x10 - 0x17 */
38ee3138f1Smrg  0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,   /* 0x18 - 0x1f */
39ee3138f1Smrg  0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,   /* 0x20 - 0x27 */
40ee3138f1Smrg  0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,   /* 0x28 - 0x2f */
41ee3138f1Smrg  0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,    0,   /* 0x30 - 0x37 */
42ee3138f1Smrg  0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,   /* 0x38 - 0x3f */
43ee3138f1Smrg  0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46,    0,   /* 0x40 - 0x47 */
44ee3138f1Smrg     0,    0,    0,    0,    0,    0,    0,    0,   /* 0x48 - 0x4f */
45ee3138f1Smrg     0,    0,    0,    0,    0,    0, 0x56, 0x57,   /* 0x50 - 0x57 */
46ee3138f1Smrg  0x58,    0,    0,    0,    0,    0,    0,    0,   /* 0x58 - 0x5f */
47ee3138f1Smrg     0,    0,    0,    0,    0,    0,    0,    0,   /* 0x60 - 0x67 */
48ee3138f1Smrg     0,    0,    0,    0,    0,    0,    0,    0,   /* 0x68 - 0x6f */
49ee3138f1Smrg     0,    0, 0x69, 0x65,    0,    0,    0,    0,   /* 0x70 - 0x77 */
50ee3138f1Smrg     0,    0,    0,    0,    0,    0,    0,    0,   /* 0x78 - 0x7f */
51ee3138f1Smrg};
52ee3138f1Smrg
53ee3138f1Smrg/* This table assumes the ibm code page 437 coding for characters
54ee3138f1Smrg * > 0x80. They are returned in this form by PCVT */
55ee3138f1Smrgstatic KeySym eascii_to_x[512] = {
56ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
57ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
58ee3138f1Smrg	XK_BackSpace,	XK_Tab,		XK_Linefeed,	NoSymbol,
59ee3138f1Smrg	NoSymbol,	XK_Return,	NoSymbol,	NoSymbol,
60ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
61ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
62ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	XK_Escape,
63ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
64ee3138f1Smrg	XK_space,	XK_exclam,	XK_quotedbl,	XK_numbersign,
65ee3138f1Smrg	XK_dollar,	XK_percent,	XK_ampersand,	XK_apostrophe,
66ee3138f1Smrg	XK_parenleft,	XK_parenright,	XK_asterisk,	XK_plus,
67ee3138f1Smrg	XK_comma,	XK_minus,	XK_period,	XK_slash,
68ee3138f1Smrg	XK_0,		XK_1,		XK_2,		XK_3,
69ee3138f1Smrg	XK_4,		XK_5,		XK_6,		XK_7,
70ee3138f1Smrg	XK_8,		XK_9,		XK_colon,	XK_semicolon,
71ee3138f1Smrg	XK_less,	XK_equal,	XK_greater,	XK_question,
72ee3138f1Smrg	XK_at,		XK_A,		XK_B,		XK_C,
73ee3138f1Smrg	XK_D,		XK_E,		XK_F,		XK_G,
74ee3138f1Smrg	XK_H,		XK_I,		XK_J,		XK_K,
75ee3138f1Smrg	XK_L,		XK_M,		XK_N,		XK_O,
76ee3138f1Smrg	XK_P,		XK_Q,		XK_R,		XK_S,
77ee3138f1Smrg	XK_T,		XK_U,		XK_V,		XK_W,
78ee3138f1Smrg	XK_X,		XK_Y,		XK_Z,		XK_bracketleft,
79ee3138f1Smrg	XK_backslash,	XK_bracketright,XK_asciicircum,	XK_underscore,
80ee3138f1Smrg	XK_grave,	XK_a,		XK_b,		XK_c,
81ee3138f1Smrg	XK_d,		XK_e,		XK_f,		XK_g,
82ee3138f1Smrg	XK_h,		XK_i,		XK_j,		XK_k,
83ee3138f1Smrg	XK_l,		XK_m,		XK_n,		XK_o,
84ee3138f1Smrg	XK_p,		XK_q,		XK_r,		XK_s,
85ee3138f1Smrg	XK_t,		XK_u,		XK_v,		XK_w,
86ee3138f1Smrg	XK_x,		XK_y,		XK_z,		XK_braceleft,
87ee3138f1Smrg	XK_bar,		XK_braceright,	XK_asciitilde,	XK_Delete,
88ee3138f1Smrg	XK_Ccedilla,	XK_udiaeresis,	XK_eacute,	XK_acircumflex,
89ee3138f1Smrg	XK_adiaeresis,	XK_agrave,	XK_aring,	XK_ccedilla,
90ee3138f1Smrg	XK_ecircumflex,	XK_ediaeresis,	XK_egrave,	XK_idiaeresis,
91ee3138f1Smrg	XK_icircumflex,	XK_igrave,	XK_Adiaeresis,	XK_Aring,
92ee3138f1Smrg	XK_Eacute,	XK_ae,		XK_AE,		XK_ocircumflex,
93ee3138f1Smrg	XK_odiaeresis,	XK_ograve,	XK_ucircumflex,	XK_ugrave,
94ee3138f1Smrg	XK_ydiaeresis,	XK_Odiaeresis,	XK_Udiaeresis,	XK_cent,
95ee3138f1Smrg	XK_sterling,	XK_yen,		XK_paragraph,	XK_section,
96ee3138f1Smrg	XK_aacute,	XK_iacute,	XK_oacute,	XK_uacute,
97ee3138f1Smrg	XK_ntilde,	XK_Ntilde,	XK_ordfeminine,	XK_masculine,
98ee3138f1Smrg	XK_questiondown,XK_hyphen,	XK_notsign,	XK_onehalf,
99ee3138f1Smrg	XK_onequarter,	XK_exclamdown,	XK_guillemotleft,XK_guillemotright,
100ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
101ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
102ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
103ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
104ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
105ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
106ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
107ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
108ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
109ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
110ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
111ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
112ee3138f1Smrg	XK_Greek_alpha,	XK_ssharp,	XK_Greek_GAMMA,	XK_Greek_pi,
113ee3138f1Smrg	XK_Greek_SIGMA,	XK_Greek_sigma,	XK_mu,	        XK_Greek_tau,
114ee3138f1Smrg	XK_Greek_PHI,	XK_Greek_THETA,	XK_Greek_OMEGA,	XK_Greek_delta,
115ee3138f1Smrg	XK_infinity,	XK_Ooblique,	XK_Greek_epsilon, XK_intersection,
116ee3138f1Smrg	XK_identical,	XK_plusminus,	XK_greaterthanequal, XK_lessthanequal,
117ee3138f1Smrg	XK_topintegral,	XK_botintegral,	XK_division,	XK_similarequal,
118ee3138f1Smrg	XK_degree,	NoSymbol,	NoSymbol,	XK_radical,
119ee3138f1Smrg	XK_Greek_eta,	XK_twosuperior,	XK_periodcentered, NoSymbol,
120ee3138f1Smrg
121ee3138f1Smrg	/*
122ee3138f1Smrg	 * special marked entries (256 + x)
123ee3138f1Smrg	 */
124ee3138f1Smrg
125ee3138f1Smrg	/* This has been checked against what syscons actually does */
126ee3138f1Smrg	NoSymbol,	NoSymbol,	XK_Shift_L,	XK_Shift_R,
127ee3138f1Smrg	XK_Caps_Lock,	XK_Num_Lock,	XK_Scroll_Lock,	XK_Alt_L,
128ee3138f1Smrg	XK_ISO_Left_Tab,XK_Control_L,	NoSymbol,	NoSymbol,
129ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
130ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
131ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
132ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	XK_F1,
133ee3138f1Smrg	XK_F2,		XK_F3,		XK_F4,		XK_F5,
134ee3138f1Smrg	XK_F6,		XK_F7,		XK_F8,		XK_F9,
135ee3138f1Smrg	XK_F10,		XK_F11,		XK_F12,		NoSymbol,
136ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
137ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
138ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
139ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
140ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
141ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
142ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
143ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
144ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
145ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
146ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
147ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
148ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
149ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
150ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
151ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
152ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
153ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
154ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
155ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
156ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
157ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
158ee3138f1Smrg	XK_Control_R,	XK_Alt_R,	NoSymbol,	NoSymbol,
159ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
160ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
161ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
162ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
163ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
164ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
165ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
166ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
167ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
168ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
169ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
170ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
171ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
172ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
173ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
174ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
175ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
176ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
177ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
178ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
179ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
180ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
181ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
182ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
183ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
184ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
185ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
186ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
187ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
188ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol,
189ee3138f1Smrg	NoSymbol,	NoSymbol,	NoSymbol,	NoSymbol
190ee3138f1Smrg};
191ee3138f1Smrg
192ee3138f1Smrg#ifdef SYSCONS_SUPPORT
193ee3138f1Smrgstatic
194ee3138f1Smrgunsigned char sysconsCODEMap[] = {
195ee3138f1Smrg	KEY_KP_Enter,	KEY_RCtrl,	KEY_KP_Divide,	KEY_Print,
196ee3138f1Smrg	KEY_AltLang,	KEY_KP_7,	KEY_KP_8,	KEY_KP_9,
197ee3138f1Smrg	KEY_KP_4,	KEY_KP_6,	KEY_KP_1,	KEY_KP_2,
198ee3138f1Smrg	KEY_KP_3,	KEY_KP_0,	KEY_KP_Decimal,	KEY_Pause,
199ee3138f1Smrg	KEY_LMeta,	KEY_RMeta,	KEY_Menu,	KEY_Break
200ee3138f1Smrg};
201ee3138f1Smrgstatic
202ee3138f1SmrgTransMapRec sysconsCODE = {
203ee3138f1Smrg    0x59,
204ee3138f1Smrg    0x6d,
205ee3138f1Smrg    sysconsCODEMap
206ee3138f1Smrg};
207ee3138f1Smrg#endif
208ee3138f1Smrg#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */
209ee3138f1Smrg
210ee3138f1Smrg#ifdef WSCONS_SUPPORT
211ee3138f1Smrg
212ee3138f1Smrgstatic CARD8 wsUsbMap[] = {
213ee3138f1Smrg	/* 0 */ KEY_NOTUSED,
214ee3138f1Smrg	/* 1 */ KEY_NOTUSED,
215ee3138f1Smrg	/* 2 */ KEY_NOTUSED,
216ee3138f1Smrg	/* 3 */ KEY_NOTUSED,
217ee3138f1Smrg	/* 4 */ KEY_A,
218ee3138f1Smrg	/* 5 */ KEY_B,
219ee3138f1Smrg	/* 6 */ KEY_C,
220ee3138f1Smrg	/* 7 */ KEY_D,
221ee3138f1Smrg	/* 8 */ KEY_E,
222ee3138f1Smrg	/* 9 */ KEY_F,
223ee3138f1Smrg	/* 10 */ KEY_G,
224ee3138f1Smrg	/* 11 */ KEY_H,
225ee3138f1Smrg	/* 12 */ KEY_I,
226ee3138f1Smrg	/* 13 */ KEY_J,
227ee3138f1Smrg	/* 14 */ KEY_K,
228ee3138f1Smrg	/* 15 */ KEY_L,
229ee3138f1Smrg	/* 16 */ KEY_M,
230ee3138f1Smrg	/* 17 */ KEY_N,
231ee3138f1Smrg	/* 18 */ KEY_O,
232ee3138f1Smrg	/* 19 */ KEY_P,
233ee3138f1Smrg	/* 20 */ KEY_Q,
234ee3138f1Smrg	/* 21 */ KEY_R,
235ee3138f1Smrg	/* 22 */ KEY_S,
236ee3138f1Smrg	/* 23 */ KEY_T,
237ee3138f1Smrg	/* 24 */ KEY_U,
238ee3138f1Smrg	/* 25 */ KEY_V,
239ee3138f1Smrg	/* 26 */ KEY_W,
240ee3138f1Smrg	/* 27 */ KEY_X,
241ee3138f1Smrg	/* 28 */ KEY_Y,
242ee3138f1Smrg	/* 29 */ KEY_Z,
243ee3138f1Smrg	/* 30 */ KEY_1,		/* 1 !*/
244ee3138f1Smrg	/* 31 */ KEY_2,		/* 2 @ */
245ee3138f1Smrg	/* 32 */ KEY_3,		/* 3 # */
246ee3138f1Smrg	/* 33 */ KEY_4,		/* 4 $ */
247ee3138f1Smrg	/* 34 */ KEY_5,		/* 5 % */
248ee3138f1Smrg	/* 35 */ KEY_6,		/* 6 ^ */
249ee3138f1Smrg	/* 36 */ KEY_7,		/* 7 & */
250ee3138f1Smrg	/* 37 */ KEY_8,		/* 8 * */
251ee3138f1Smrg	/* 38 */ KEY_9,		/* 9 ( */
252ee3138f1Smrg	/* 39 */ KEY_0,		/* 0 ) */
253ee3138f1Smrg	/* 40 */ KEY_Enter,	/* Return  */
254ee3138f1Smrg	/* 41 */ KEY_Escape,	/* Escape */
255ee3138f1Smrg	/* 42 */ KEY_BackSpace,	/* Backspace Delete */
256ee3138f1Smrg	/* 43 */ KEY_Tab,	/* Tab */
257ee3138f1Smrg	/* 44 */ KEY_Space,	/* Space */
258ee3138f1Smrg	/* 45 */ KEY_Minus,	/* - _ */
259ee3138f1Smrg	/* 46 */ KEY_Equal,	/* = + */
260ee3138f1Smrg	/* 47 */ KEY_LBrace,	/* [ { */
261ee3138f1Smrg	/* 48 */ KEY_RBrace,	/* ] } */
262ee3138f1Smrg	/* 49 */ KEY_BSlash,	/* \ | */
26351aca463Smartin	/* 50 */ KEY_BSlash,    /* \ _ # ~ on some keyboards */
264ee3138f1Smrg	/* 51 */ KEY_SemiColon,	/* ; : */
265ee3138f1Smrg	/* 52 */ KEY_Quote,	/* ' " */
266ee3138f1Smrg	/* 53 */ KEY_Tilde,	/* ` ~ */
267ee3138f1Smrg	/* 54 */ KEY_Comma,	/* , <  */
268ee3138f1Smrg	/* 55 */ KEY_Period,	/* . > */
269ee3138f1Smrg	/* 56 */ KEY_Slash,	/* / ? */
270ee3138f1Smrg	/* 57 */ KEY_CapsLock,	/* Caps Lock */
271ee3138f1Smrg	/* 58 */ KEY_F1,		/* F1 */
272ee3138f1Smrg	/* 59 */ KEY_F2,		/* F2 */
273ee3138f1Smrg	/* 60 */ KEY_F3,		/* F3 */
274ee3138f1Smrg	/* 61 */ KEY_F4,		/* F4 */
275ee3138f1Smrg	/* 62 */ KEY_F5,		/* F5 */
276ee3138f1Smrg	/* 63 */ KEY_F6,		/* F6 */
277ee3138f1Smrg	/* 64 */ KEY_F7,		/* F7 */
278ee3138f1Smrg	/* 65 */ KEY_F8,		/* F8 */
279ee3138f1Smrg	/* 66 */ KEY_F9,		/* F9 */
280ee3138f1Smrg	/* 67 */ KEY_F10,	/* F10 */
281ee3138f1Smrg	/* 68 */ KEY_F11,	/* F11 */
282ee3138f1Smrg	/* 69 */ KEY_F12,	/* F12 */
283ee3138f1Smrg	/* 70 */ KEY_Print,	/* PrintScrn SysReq */
284ee3138f1Smrg	/* 71 */ KEY_ScrollLock,	/* Scroll Lock */
285ee3138f1Smrg	/* 72 */ KEY_Pause,	/* Pause Break */
286ee3138f1Smrg	/* 73 */ KEY_Insert,	/* Insert XXX  Help on some Mac Keyboards */
287ee3138f1Smrg	/* 74 */ KEY_Home,	/* Home */
288ee3138f1Smrg	/* 75 */ KEY_PgUp,	/* Page Up */
289ee3138f1Smrg	/* 76 */ KEY_Delete,	/* Delete */
290ee3138f1Smrg	/* 77 */ KEY_End,	/* End */
291ee3138f1Smrg	/* 78 */ KEY_PgDown,	/* Page Down */
292ee3138f1Smrg	/* 79 */ KEY_Right,	/* Right Arrow */
293ee3138f1Smrg	/* 80 */ KEY_Left,	/* Left Arrow */
294ee3138f1Smrg	/* 81 */ KEY_Down,	/* Down Arrow */
295ee3138f1Smrg	/* 82 */ KEY_Up,		/* Up Arrow */
296ee3138f1Smrg	/* 83 */ KEY_NumLock,	/* Num Lock */
297ee3138f1Smrg	/* 84 */ KEY_KP_Divide,	/* Keypad / */
298ee3138f1Smrg	/* 85 */ KEY_KP_Multiply, /* Keypad * */
299ee3138f1Smrg	/* 86 */ KEY_KP_Minus,	/* Keypad - */
300ee3138f1Smrg	/* 87 */ KEY_KP_Plus,	/* Keypad + */
301ee3138f1Smrg	/* 88 */ KEY_KP_Enter,	/* Keypad Enter */
302ee3138f1Smrg	/* 89 */ KEY_KP_1,	/* Keypad 1 End */
303ee3138f1Smrg	/* 90 */ KEY_KP_2,	/* Keypad 2 Down */
304ee3138f1Smrg	/* 91 */ KEY_KP_3,	/* Keypad 3 Pg Down */
305ee3138f1Smrg	/* 92 */ KEY_KP_4,	/* Keypad 4 Left  */
306ee3138f1Smrg	/* 93 */ KEY_KP_5,	/* Keypad 5 */
307ee3138f1Smrg	/* 94 */ KEY_KP_6,	/* Keypad 6 */
308ee3138f1Smrg	/* 95 */ KEY_KP_7,	/* Keypad 7 Home */
309ee3138f1Smrg	/* 96 */ KEY_KP_8,	/* Keypad 8 Up */
310ee3138f1Smrg	/* 97 */ KEY_KP_9,	/* KEypad 9 Pg Up */
311ee3138f1Smrg	/* 98 */ KEY_KP_0,	/* Keypad 0 Ins */
312ee3138f1Smrg	/* 99 */ KEY_KP_Decimal,	/* Keypad . Del */
313ee3138f1Smrg	/* 100 */ KEY_Less,	/* < > on some keyboards */
314ee3138f1Smrg	/* 101 */ KEY_Menu,	/* Menu */
315713cff54Smacallan	/* 102 */ KEY_Power,	/* sleep key on Sun USB */
316ee3138f1Smrg	/* 103 */ KEY_KP_Equal, /* Keypad = on Mac keyboards */
317713cff54Smacallan	/* 104 */ KEY_F13,
318713cff54Smacallan	/* 105 */ KEY_F14,
319713cff54Smacallan	/* 106 */ KEY_F15,
320713cff54Smacallan	/* 107 */ KEY_F16,
321ee3138f1Smrg	/* 108 */ KEY_NOTUSED,
322713cff54Smacallan	/* 109 */ KEY_Power,
323ee3138f1Smrg	/* 110 */ KEY_NOTUSED,
324ee3138f1Smrg	/* 111 */ KEY_NOTUSED,
325ee3138f1Smrg	/* 112 */ KEY_NOTUSED,
326ee3138f1Smrg	/* 113 */ KEY_NOTUSED,
327ee3138f1Smrg	/* 114 */ KEY_NOTUSED,
328ee3138f1Smrg	/* 115 */ KEY_NOTUSED,
329713cff54Smacallan	/* 116 */ KEY_L7,
330713cff54Smacallan	/* 117 */ KEY_Help,
331713cff54Smacallan	/* 118 */ KEY_L3,
332713cff54Smacallan	/* 119 */ KEY_L5,
333713cff54Smacallan	/* 120 */ KEY_L1,
334713cff54Smacallan	/* 121 */ KEY_L2,
335713cff54Smacallan	/* 122 */ KEY_L4,
336713cff54Smacallan	/* 123 */ KEY_L10,
337713cff54Smacallan	/* 124 */ KEY_L6,
338713cff54Smacallan	/* 125 */ KEY_L8,
339713cff54Smacallan	/* 126 */ KEY_L9,
340713cff54Smacallan	/* 127 */ KEY_Mute,
341713cff54Smacallan	/* 128 */ KEY_AudioRaise,
342713cff54Smacallan	/* 129 */ KEY_AudioLower,
343ee3138f1Smrg	/* 130 */ KEY_NOTUSED,
344ee3138f1Smrg	/* 131 */ KEY_NOTUSED,
345ee3138f1Smrg	/* 132 */ KEY_NOTUSED,
346ee3138f1Smrg	/* 133 */ KEY_NOTUSED,
347ee3138f1Smrg	/* 134 */ KEY_NOTUSED,
3488e3c6fe8Schristos/*
3491468c73eSmrg * Special keycodes for Japanese keyboards
3501468c73eSmrg * Override atKeyname HKTG and BSlash2 code to unique values for JP106 keyboards
3518e3c6fe8Schristos */
3528e3c6fe8Schristos#undef KEY_HKTG
3531468c73eSmrg#define KEY_HKTG	200	/* Japanese Hiragana Katakana Toggle */
3548e3c6fe8Schristos#undef KEY_BSlash2
3558e3c6fe8Schristos#define KEY_BSlash2	203	/* Japanese '\_' key */
3568e3c6fe8Schristos
3578e3c6fe8Schristos	/* 135 */ KEY_BSlash2,	/* Japanese 106 kbd: '\_' */
3588e3c6fe8Schristos	/* 136 */ KEY_HKTG,	/* Japanese 106 kbd: Hiragana Katakana toggle */
3598e3c6fe8Schristos	/* 137 */ KEY_Yen,	/* Japanese 106 kbd: '\|' */
3608e3c6fe8Schristos	/* 138 */ KEY_XFER,	/* Japanese 106 kbd: Henkan */
3618e3c6fe8Schristos	/* 139 */ KEY_NFER,	/* Japanese 106 kbd: Muhenkan */
362ee3138f1Smrg	/* 140 */ KEY_NOTUSED,
363ee3138f1Smrg	/* 141 */ KEY_NOTUSED,
364ee3138f1Smrg	/* 142 */ KEY_NOTUSED,
365ee3138f1Smrg	/* 143 */ KEY_NOTUSED,
3668e3c6fe8Schristos/*
3671468c73eSmrg * Special keycodes for Korean keyboards
3681468c73eSmrg * Define Hangul and Hangul_Hanja unique key codes
3691468c73eSmrg * These keys also use KANA and EISU on some Macintosh Japanese USB keyboards
3708e3c6fe8Schristos */
3718e3c6fe8Schristos#define KEY_Hangul		201	/* Also KANA Key on Mac JP USB kbd */
3728e3c6fe8Schristos#define KEY_Hangul_Hanja	202	/* Also EISU Key on Mac JP USB kbd */
3738e3c6fe8Schristos	/* 144 */ KEY_Hangul,		/* Korean 106 kbd: Hangul */
3748e3c6fe8Schristos	/* 145 */ KEY_Hangul_Hanja,	/* Korean 106 kbd: Hangul Hanja */
375ee3138f1Smrg	/* 146 */ KEY_NOTUSED,
376ee3138f1Smrg	/* 147 */ KEY_NOTUSED,
377ee3138f1Smrg	/* 148 */ KEY_NOTUSED,
378ee3138f1Smrg	/* 149 */ KEY_NOTUSED,
379ee3138f1Smrg	/* 150 */ KEY_NOTUSED,
380ee3138f1Smrg	/* 151 */ KEY_NOTUSED,
381ee3138f1Smrg	/* 152 */ KEY_NOTUSED,
382ee3138f1Smrg	/* 153 */ KEY_NOTUSED,
383ee3138f1Smrg	/* 154 */ KEY_NOTUSED,
384ee3138f1Smrg	/* 155 */ KEY_NOTUSED,
385ee3138f1Smrg	/* 156 */ KEY_NOTUSED,
386ee3138f1Smrg	/* 157 */ KEY_NOTUSED,
387ee3138f1Smrg	/* 158 */ KEY_NOTUSED,
388ee3138f1Smrg	/* 159 */ KEY_NOTUSED,
389ee3138f1Smrg	/* 160 */ KEY_NOTUSED,
390ee3138f1Smrg	/* 161 */ KEY_NOTUSED,
391ee3138f1Smrg	/* 162 */ KEY_NOTUSED,
392ee3138f1Smrg	/* 163 */ KEY_NOTUSED,
393ee3138f1Smrg	/* 164 */ KEY_NOTUSED,
394ee3138f1Smrg	/* 165 */ KEY_NOTUSED,
395ee3138f1Smrg	/* 166 */ KEY_NOTUSED,
396ee3138f1Smrg	/* 167 */ KEY_NOTUSED,
397ee3138f1Smrg	/* 168 */ KEY_NOTUSED,
398ee3138f1Smrg	/* 169 */ KEY_NOTUSED,
399ee3138f1Smrg	/* 170 */ KEY_NOTUSED,
400ee3138f1Smrg	/* 171 */ KEY_NOTUSED,
401ee3138f1Smrg	/* 172 */ KEY_NOTUSED,
402ee3138f1Smrg	/* 173 */ KEY_NOTUSED,
403ee3138f1Smrg	/* 174 */ KEY_NOTUSED,
404ee3138f1Smrg	/* 175 */ KEY_NOTUSED,
405ee3138f1Smrg	/* 176 */ KEY_NOTUSED,
406ee3138f1Smrg	/* 177 */ KEY_NOTUSED,
407ee3138f1Smrg	/* 178 */ KEY_NOTUSED,
408ee3138f1Smrg	/* 179 */ KEY_NOTUSED,
409ee3138f1Smrg	/* 180 */ KEY_NOTUSED,
410ee3138f1Smrg	/* 181 */ KEY_NOTUSED,
411ee3138f1Smrg	/* 182 */ KEY_NOTUSED,
412ee3138f1Smrg	/* 183 */ KEY_NOTUSED,
413ee3138f1Smrg	/* 184 */ KEY_NOTUSED,
414ee3138f1Smrg	/* 185 */ KEY_NOTUSED,
415ee3138f1Smrg	/* 186 */ KEY_NOTUSED,
416ee3138f1Smrg	/* 187 */ KEY_NOTUSED,
417ee3138f1Smrg	/* 188 */ KEY_NOTUSED,
418ee3138f1Smrg	/* 189 */ KEY_NOTUSED,
419ee3138f1Smrg	/* 190 */ KEY_NOTUSED,
420ee3138f1Smrg	/* 191 */ KEY_NOTUSED,
421ee3138f1Smrg	/* 192 */ KEY_NOTUSED,
422ee3138f1Smrg	/* 193 */ KEY_NOTUSED,
423ee3138f1Smrg	/* 194 */ KEY_NOTUSED,
424ee3138f1Smrg	/* 195 */ KEY_NOTUSED,
425ee3138f1Smrg	/* 196 */ KEY_NOTUSED,
426ee3138f1Smrg	/* 197 */ KEY_NOTUSED,
427ee3138f1Smrg	/* 198 */ KEY_NOTUSED,
428ee3138f1Smrg	/* 199 */ KEY_NOTUSED,
429ee3138f1Smrg	/* 200 */ KEY_NOTUSED,
430ee3138f1Smrg	/* 201 */ KEY_NOTUSED,
431ee3138f1Smrg	/* 202 */ KEY_NOTUSED,
432ee3138f1Smrg	/* 203 */ KEY_NOTUSED,
433ee3138f1Smrg	/* 204 */ KEY_NOTUSED,
434ee3138f1Smrg	/* 205 */ KEY_NOTUSED,
435ee3138f1Smrg	/* 206 */ KEY_NOTUSED,
436ee3138f1Smrg	/* 207 */ KEY_NOTUSED,
437ee3138f1Smrg	/* 208 */ KEY_NOTUSED,
438ee3138f1Smrg	/* 209 */ KEY_NOTUSED,
439ee3138f1Smrg	/* 210 */ KEY_NOTUSED,
440ee3138f1Smrg	/* 211 */ KEY_NOTUSED,
441ee3138f1Smrg	/* 212 */ KEY_NOTUSED,
442ee3138f1Smrg	/* 213 */ KEY_NOTUSED,
443ee3138f1Smrg	/* 214 */ KEY_NOTUSED,
444ee3138f1Smrg	/* 215 */ KEY_NOTUSED,
445ee3138f1Smrg	/* 216 */ KEY_NOTUSED,
446ee3138f1Smrg	/* 217 */ KEY_NOTUSED,
447ee3138f1Smrg	/* 218 */ KEY_NOTUSED,
448ee3138f1Smrg	/* 219 */ KEY_NOTUSED,
449ee3138f1Smrg	/* 220 */ KEY_NOTUSED,
450ee3138f1Smrg	/* 221 */ KEY_NOTUSED,
451ee3138f1Smrg	/* 222 */ KEY_NOTUSED,
452ee3138f1Smrg	/* 223 */ KEY_NOTUSED,
453ee3138f1Smrg	/* 224 */ KEY_LCtrl,	/* Left Control */
454ee3138f1Smrg	/* 225 */ KEY_ShiftL,	/* Left Shift */
455ee3138f1Smrg	/* 226 */ KEY_Alt,	/* Left Alt */
456ee3138f1Smrg	/* 227 */ KEY_LMeta,	/* Left Meta */
457ee3138f1Smrg	/* 228 */ KEY_RCtrl,	/* Right Control */
458ee3138f1Smrg	/* 229 */ KEY_ShiftR,	/* Right Shift */
459ee3138f1Smrg	/* 230 */ KEY_AltLang,	/* Right Alt, AKA AltGr */
460ee3138f1Smrg	/* 231 */ KEY_LMeta,	/* Right Meta XXX */
461ee3138f1Smrg};
462aa8e367bSmrg#define WS_USB_MAP_SIZE (sizeof(wsUsbMap)/sizeof(*wsUsbMap))
463ee3138f1Smrg
464ee3138f1Smrgstatic
465ee3138f1SmrgTransMapRec wsUsb = {
466ee3138f1Smrg    0,
467ee3138f1Smrg    WS_USB_MAP_SIZE,
468ee3138f1Smrg    wsUsbMap
469ee3138f1Smrg};
470ee3138f1Smrg
471ac15d2bcSmacallanstatic CARD8 wsXtMap[] = {
472ac15d2bcSmacallan	/* 0 */ KEY_NOTUSED,
473ac15d2bcSmacallan	/* 1 */ KEY_Escape,
474ac15d2bcSmacallan	/* 2 */ KEY_1,
475ac15d2bcSmacallan	/* 3 */ KEY_2,
476aa8e367bSmrg	/* 4 */ KEY_3,
477ac15d2bcSmacallan	/* 5 */ KEY_4,
478ac15d2bcSmacallan	/* 6 */ KEY_5,
479ac15d2bcSmacallan	/* 7 */ KEY_6,
480ac15d2bcSmacallan	/* 8 */ KEY_7,
481ac15d2bcSmacallan	/* 9 */ KEY_8,
482ac15d2bcSmacallan	/* 10 */ KEY_9,
483ac15d2bcSmacallan	/* 11 */ KEY_0,
484ac15d2bcSmacallan	/* 12 */ KEY_Minus,
485ac15d2bcSmacallan	/* 13 */ KEY_Equal,
486ac15d2bcSmacallan	/* 14 */ KEY_BackSpace,
487ac15d2bcSmacallan	/* 15 */ KEY_Tab,
488ac15d2bcSmacallan	/* 16 */ KEY_Q,
489ac15d2bcSmacallan	/* 17 */ KEY_W,
490ac15d2bcSmacallan	/* 18 */ KEY_E,
491ac15d2bcSmacallan	/* 19 */ KEY_R,
492ac15d2bcSmacallan	/* 20 */ KEY_T,
493ac15d2bcSmacallan	/* 21 */ KEY_Y,
494ac15d2bcSmacallan	/* 22 */ KEY_U,
495ac15d2bcSmacallan	/* 23 */ KEY_I,
496ac15d2bcSmacallan	/* 24 */ KEY_O,
497ac15d2bcSmacallan	/* 25 */ KEY_P,
498ac15d2bcSmacallan	/* 26 */ KEY_LBrace,
499ac15d2bcSmacallan	/* 27 */ KEY_RBrace,
500ac15d2bcSmacallan	/* 28 */ KEY_Enter,
501ac15d2bcSmacallan	/* 29 */ KEY_LCtrl,
502ac15d2bcSmacallan	/* 30 */ KEY_A,
503ac15d2bcSmacallan	/* 31 */ KEY_S,
504ac15d2bcSmacallan	/* 32 */ KEY_D,
505ac15d2bcSmacallan	/* 33 */ KEY_F,
506ac15d2bcSmacallan	/* 34 */ KEY_G,
507ac15d2bcSmacallan	/* 35 */ KEY_H,
508ac15d2bcSmacallan	/* 36 */ KEY_J,
509ac15d2bcSmacallan	/* 37 */ KEY_K,
510ac15d2bcSmacallan	/* 38 */ KEY_L,
511ac15d2bcSmacallan	/* 39 */ KEY_SemiColon,
512ac15d2bcSmacallan	/* 40 */ KEY_Quote,
513ac15d2bcSmacallan	/* 41 */ KEY_Tilde,
514ac15d2bcSmacallan	/* 42 */ KEY_ShiftL,
515ac15d2bcSmacallan	/* 43 */ KEY_BSlash,
516ac15d2bcSmacallan	/* 44 */ KEY_Z,
517ac15d2bcSmacallan	/* 45 */ KEY_X,
518ac15d2bcSmacallan	/* 46 */ KEY_C,
519ac15d2bcSmacallan	/* 47 */ KEY_V,
520ac15d2bcSmacallan	/* 48 */ KEY_B,
521ac15d2bcSmacallan	/* 49 */ KEY_N,
522ac15d2bcSmacallan	/* 50 */ KEY_M,
523ac15d2bcSmacallan	/* 51 */ KEY_Comma,
524ac15d2bcSmacallan	/* 52 */ KEY_Period,
525ac15d2bcSmacallan	/* 53 */ KEY_Slash,
526ac15d2bcSmacallan	/* 54 */ KEY_ShiftR,
527ac15d2bcSmacallan	/* 55 */ KEY_KP_Multiply,
528ac15d2bcSmacallan	/* 56 */ KEY_Alt,
529ac15d2bcSmacallan	/* 57 */ KEY_Space,
530ac15d2bcSmacallan	/* 58 */ KEY_CapsLock,
531ac15d2bcSmacallan	/* 59 */ KEY_F1,
532ac15d2bcSmacallan	/* 60 */ KEY_F2,
533ac15d2bcSmacallan	/* 61 */ KEY_F3,
534ac15d2bcSmacallan	/* 62 */ KEY_F4,
535ac15d2bcSmacallan	/* 63 */ KEY_F5,
536ac15d2bcSmacallan	/* 64 */ KEY_F6,
537ac15d2bcSmacallan	/* 65 */ KEY_F7,
538ac15d2bcSmacallan	/* 66 */ KEY_F8,
539ac15d2bcSmacallan	/* 67 */ KEY_F9,
540ac15d2bcSmacallan	/* 68 */ KEY_F10,
541ac15d2bcSmacallan	/* 69 */ KEY_NumLock,
542ac15d2bcSmacallan	/* 70 */ KEY_ScrollLock,
543ac15d2bcSmacallan	/* 71 */ KEY_KP_7,
544ac15d2bcSmacallan	/* 72 */ KEY_KP_8,
545ac15d2bcSmacallan	/* 73 */ KEY_KP_9,
546ac15d2bcSmacallan	/* 74 */ KEY_KP_Minus,
547ac15d2bcSmacallan	/* 75 */ KEY_KP_4,
548ac15d2bcSmacallan	/* 76 */ KEY_KP_5,
549ac15d2bcSmacallan	/* 77 */ KEY_KP_6,
550ac15d2bcSmacallan	/* 78 */ KEY_KP_Plus,
551ac15d2bcSmacallan	/* 79 */ KEY_KP_1,
552ac15d2bcSmacallan	/* 80 */ KEY_KP_2,
553ac15d2bcSmacallan	/* 81 */ KEY_KP_3,
554ac15d2bcSmacallan	/* 82 */ KEY_KP_0,
555ac15d2bcSmacallan	/* 83 */ KEY_KP_Decimal,
556ac15d2bcSmacallan	/* 84 */ KEY_NOTUSED,
557ac15d2bcSmacallan	/* 85 */ KEY_NOTUSED,
558ac15d2bcSmacallan	/* 86 */ KEY_Less,	/* backslash on uk, < on german */
559ac15d2bcSmacallan	/* 87 */ KEY_F11,
560ac15d2bcSmacallan	/* 88 */ KEY_F12,
561ac15d2bcSmacallan	/* 89 */ KEY_NOTUSED,
562ac15d2bcSmacallan	/* 90 */ KEY_NOTUSED,
563ac15d2bcSmacallan	/* 91 */ KEY_NOTUSED,
564ac15d2bcSmacallan	/* 92 */ KEY_NOTUSED,
565ac15d2bcSmacallan	/* 93 */ KEY_NOTUSED,
566ac15d2bcSmacallan	/* 94 */ KEY_NOTUSED,
567ac15d2bcSmacallan	/* 95 */ KEY_NOTUSED,
568ac15d2bcSmacallan	/* 96 */ KEY_NOTUSED,
569ac15d2bcSmacallan	/* 97 */ KEY_NOTUSED,
570ac15d2bcSmacallan	/* 98 */ KEY_NOTUSED,
571ac15d2bcSmacallan	/* 99 */ KEY_NOTUSED,
572ac15d2bcSmacallan	/* 100 */ KEY_NOTUSED,
573ac15d2bcSmacallan	/* 101 */ KEY_NOTUSED,
574ac15d2bcSmacallan	/* 102 */ KEY_NOTUSED,
575ac15d2bcSmacallan	/* 103 */ KEY_NOTUSED,
576ac15d2bcSmacallan	/* 104 */ KEY_NOTUSED,
577ac15d2bcSmacallan	/* 105 */ KEY_NOTUSED,
578ac15d2bcSmacallan	/* 106 */ KEY_NOTUSED,
579ac15d2bcSmacallan	/* 107 */ KEY_NOTUSED,
580ac15d2bcSmacallan	/* 108 */ KEY_NOTUSED,
581ac15d2bcSmacallan	/* 109 */ KEY_NOTUSED,
582ac15d2bcSmacallan	/* 110 */ KEY_NOTUSED,
583ac15d2bcSmacallan	/* 111 */ KEY_NOTUSED,
584ac15d2bcSmacallan	/* 112 */ KEY_NOTUSED,
585ac15d2bcSmacallan	/* 113 */ KEY_NOTUSED,
586ac15d2bcSmacallan	/* 114 */ KEY_NOTUSED,
587ac15d2bcSmacallan	/* 115 */ KEY_NOTUSED,
588ac15d2bcSmacallan	/* 116 */ KEY_NOTUSED,
589ac15d2bcSmacallan	/* 117 */ KEY_NOTUSED,
590ac15d2bcSmacallan	/* 118 */ KEY_NOTUSED,
591ac15d2bcSmacallan	/* 119 */ KEY_NOTUSED,
592ac15d2bcSmacallan	/* 120 */ KEY_NOTUSED,
593ac15d2bcSmacallan	/* 121 */ KEY_NOTUSED,
594ac15d2bcSmacallan	/* 122 */ KEY_NOTUSED,
595ac15d2bcSmacallan	/* 123 */ KEY_NOTUSED,
596ac15d2bcSmacallan	/* 124 */ KEY_NOTUSED,
597ac15d2bcSmacallan	/* 125 */ KEY_NOTUSED,
598ac15d2bcSmacallan	/* 126 */ KEY_NOTUSED,
599ac15d2bcSmacallan	/* 127 */ KEY_Pause,
600ac15d2bcSmacallan	/* 128 */ KEY_NOTUSED,
601ac15d2bcSmacallan	/* 129 */ KEY_NOTUSED,
602ac15d2bcSmacallan	/* 130 */ KEY_NOTUSED,
603ac15d2bcSmacallan	/* 131 */ KEY_NOTUSED,
604ac15d2bcSmacallan	/* 132 */ KEY_NOTUSED,
605ac15d2bcSmacallan	/* 133 */ KEY_NOTUSED,
606ac15d2bcSmacallan	/* 134 */ KEY_NOTUSED,
607ac15d2bcSmacallan	/* 135 */ KEY_NOTUSED,
608ac15d2bcSmacallan	/* 136 */ KEY_NOTUSED,
609ac15d2bcSmacallan	/* 137 */ KEY_NOTUSED,
610ac15d2bcSmacallan	/* 138 */ KEY_NOTUSED,
611ac15d2bcSmacallan	/* 139 */ KEY_NOTUSED,
612ac15d2bcSmacallan	/* 140 */ KEY_NOTUSED,
613ac15d2bcSmacallan	/* 141 */ KEY_NOTUSED,
614ac15d2bcSmacallan	/* 142 */ KEY_NOTUSED,
615ac15d2bcSmacallan	/* 143 */ KEY_NOTUSED,
616ac15d2bcSmacallan	/* 144 */ KEY_NOTUSED,
617ac15d2bcSmacallan	/* 145 */ KEY_NOTUSED,
618ac15d2bcSmacallan	/* 146 */ KEY_NOTUSED,
619ac15d2bcSmacallan	/* 147 */ KEY_NOTUSED,
620ac15d2bcSmacallan	/* 148 */ KEY_NOTUSED,
621ac15d2bcSmacallan	/* 149 */ KEY_NOTUSED,
622ac15d2bcSmacallan	/* 150 */ KEY_NOTUSED,
623ac15d2bcSmacallan	/* 151 */ KEY_NOTUSED,
624ac15d2bcSmacallan	/* 152 */ KEY_NOTUSED,
625ac15d2bcSmacallan	/* 153 */ KEY_NOTUSED,
626ac15d2bcSmacallan	/* 154 */ KEY_NOTUSED,
627ac15d2bcSmacallan	/* 155 */ KEY_NOTUSED,
628ac15d2bcSmacallan	/* 156 */ KEY_KP_Enter,
629ac15d2bcSmacallan	/* 157 */ KEY_RCtrl,
630ac15d2bcSmacallan	/* 158 */ KEY_NOTUSED,
631ac15d2bcSmacallan	/* 159 */ KEY_NOTUSED,
632ac15d2bcSmacallan	/* 160 */ KEY_Mute,
633ac15d2bcSmacallan	/* 161 */ KEY_NOTUSED,
634ac15d2bcSmacallan	/* 162 */ KEY_NOTUSED,
635ac15d2bcSmacallan	/* 163 */ KEY_NOTUSED,
636ac15d2bcSmacallan	/* 164 */ KEY_NOTUSED,
637ac15d2bcSmacallan	/* 165 */ KEY_NOTUSED,
638ac15d2bcSmacallan	/* 166 */ KEY_NOTUSED,
639ac15d2bcSmacallan	/* 167 */ KEY_NOTUSED,
640ac15d2bcSmacallan	/* 168 */ KEY_NOTUSED,
641ac15d2bcSmacallan	/* 169 */ KEY_NOTUSED,
642ac15d2bcSmacallan	/* 170 */ KEY_Print,
643ac15d2bcSmacallan	/* 171 */ KEY_NOTUSED,
644ac15d2bcSmacallan	/* 172 */ KEY_NOTUSED,
645ac15d2bcSmacallan	/* 173 */ KEY_NOTUSED,
646ac15d2bcSmacallan	/* 174 */ KEY_AudioLower,
647ac15d2bcSmacallan	/* 175 */ KEY_AudioRaise,
648ac15d2bcSmacallan	/* 176 */ KEY_NOTUSED,
649ac15d2bcSmacallan	/* 177 */ KEY_NOTUSED,
650ac15d2bcSmacallan	/* 178 */ KEY_NOTUSED,
651ac15d2bcSmacallan	/* 179 */ KEY_NOTUSED,
652ac15d2bcSmacallan	/* 180 */ KEY_NOTUSED,
653ac15d2bcSmacallan	/* 181 */ KEY_KP_Divide,
654ac15d2bcSmacallan	/* 182 */ KEY_NOTUSED,
655ac15d2bcSmacallan	/* 183 */ KEY_Print,
656ac15d2bcSmacallan	/* 184 */ KEY_AltLang,
657ac15d2bcSmacallan	/* 185 */ KEY_NOTUSED,
658ac15d2bcSmacallan	/* 186 */ KEY_NOTUSED,
659ac15d2bcSmacallan	/* 187 */ KEY_NOTUSED,
660ac15d2bcSmacallan	/* 188 */ KEY_NOTUSED,
661ac15d2bcSmacallan	/* 189 */ KEY_NOTUSED,
662ac15d2bcSmacallan	/* 190 */ KEY_NOTUSED,
663ac15d2bcSmacallan	/* 191 */ KEY_NOTUSED,
664ac15d2bcSmacallan	/* 192 */ KEY_NOTUSED,
665ac15d2bcSmacallan	/* 193 */ KEY_NOTUSED,
666ac15d2bcSmacallan	/* 194 */ KEY_NOTUSED,
667ac15d2bcSmacallan	/* 195 */ KEY_NOTUSED,
668ac15d2bcSmacallan	/* 196 */ KEY_NOTUSED,
669ac15d2bcSmacallan	/* 197 */ KEY_NOTUSED,
670ac15d2bcSmacallan	/* 198 */ KEY_NOTUSED,
671ac15d2bcSmacallan	/* 199 */ KEY_Home,
672ac15d2bcSmacallan	/* 200 */ KEY_Up,
673ac15d2bcSmacallan	/* 201 */ KEY_PgUp,
674ac15d2bcSmacallan	/* 202 */ KEY_NOTUSED,
675ac15d2bcSmacallan	/* 203 */ KEY_Left,
676ac15d2bcSmacallan	/* 204 */ KEY_NOTUSED,
677ac15d2bcSmacallan	/* 205 */ KEY_Right,
678ac15d2bcSmacallan	/* 206 */ KEY_NOTUSED,
679ac15d2bcSmacallan	/* 207 */ KEY_End,
680ac15d2bcSmacallan	/* 208 */ KEY_Down,
681ac15d2bcSmacallan	/* 209 */ KEY_PgDown,
682ac15d2bcSmacallan	/* 210 */ KEY_Insert,
683ac15d2bcSmacallan	/* 211 */ KEY_Delete,
684ac15d2bcSmacallan	/* 212 */ KEY_NOTUSED,
685ac15d2bcSmacallan	/* 213 */ KEY_NOTUSED,
686ac15d2bcSmacallan	/* 214 */ KEY_NOTUSED,
687ac15d2bcSmacallan	/* 215 */ KEY_NOTUSED,
688ac15d2bcSmacallan	/* 216 */ KEY_NOTUSED,
689ac15d2bcSmacallan	/* 217 */ KEY_NOTUSED,
690ac15d2bcSmacallan	/* 218 */ KEY_NOTUSED,
691ac15d2bcSmacallan	/* 219 */ KEY_LMeta,
692ac15d2bcSmacallan	/* 220 */ KEY_RMeta,
693ac15d2bcSmacallan	/* 221 */ KEY_Menu,
694ac15d2bcSmacallan};
695aa8e367bSmrg#define WS_XT_MAP_SIZE (sizeof(wsXtMap)/sizeof(*wsXtMap))
696ac15d2bcSmacallan
697ac15d2bcSmacallanstatic
698ac15d2bcSmacallanTransMapRec wsXt = {
699ac15d2bcSmacallan    0,
700ac15d2bcSmacallan    WS_XT_MAP_SIZE,
701ac15d2bcSmacallan    wsXtMap
702ac15d2bcSmacallan};
703ac15d2bcSmacallan
704ee3138f1Smrg/* Map for adb keyboards  */
705ee3138f1Smrgstatic CARD8 wsAdbMap[] = {
706ee3138f1Smrg	/* 0 */ KEY_A,
707ee3138f1Smrg	/* 1 */ KEY_S,
708ee3138f1Smrg	/* 2 */ KEY_D,
709ee3138f1Smrg	/* 3 */ KEY_F,
710ee3138f1Smrg	/* 4 */ KEY_H,
711ee3138f1Smrg	/* 5 */ KEY_G,
712ee3138f1Smrg	/* 6 */ KEY_Z,
713ee3138f1Smrg	/* 7 */ KEY_X,
714ee3138f1Smrg	/* 8 */ KEY_C,
715ee3138f1Smrg	/* 9 */ KEY_V,
716ee3138f1Smrg	/* 10 */ KEY_UNKNOWN,	/* @ # on french keyboards */
717ee3138f1Smrg	/* 11 */ KEY_B,
718ee3138f1Smrg	/* 12 */ KEY_Q,
719ee3138f1Smrg	/* 13 */ KEY_W,
720ee3138f1Smrg	/* 14 */ KEY_E,
721ee3138f1Smrg	/* 15 */ KEY_R,
722ee3138f1Smrg	/* 16 */ KEY_Y,
723ee3138f1Smrg	/* 17 */ KEY_T,
724ee3138f1Smrg	/* 18 */ KEY_1,
725ee3138f1Smrg	/* 19 */ KEY_2,
726ee3138f1Smrg	/* 20 */ KEY_3,
727ee3138f1Smrg	/* 21 */ KEY_4,
728ee3138f1Smrg	/* 22 */ KEY_6,
729ee3138f1Smrg	/* 23 */ KEY_5,
730ee3138f1Smrg	/* 24 */ KEY_Equal,
731ee3138f1Smrg	/* 25 */ KEY_9,
732ee3138f1Smrg	/* 26 */ KEY_7,
733ee3138f1Smrg	/* 27 */ KEY_Minus,
734ee3138f1Smrg	/* 28 */ KEY_8,
735ee3138f1Smrg	/* 29 */ KEY_0,
736ee3138f1Smrg	/* 30 */ KEY_RBrace,
737ee3138f1Smrg	/* 31 */ KEY_O,
738ee3138f1Smrg	/* 32 */ KEY_U,
739ee3138f1Smrg	/* 33 */ KEY_LBrace,
740ee3138f1Smrg	/* 34 */ KEY_I,
741ee3138f1Smrg	/* 35 */ KEY_P,
742ee3138f1Smrg	/* 36 */ KEY_Enter,
743ee3138f1Smrg	/* 37 */ KEY_L,
744ee3138f1Smrg	/* 38 */ KEY_J,
745ee3138f1Smrg	/* 39 */ KEY_Quote,
746ee3138f1Smrg	/* 40 */ KEY_K,
747ee3138f1Smrg	/* 41 */ KEY_SemiColon,
748ee3138f1Smrg	/* 42 */ KEY_BSlash,
749ee3138f1Smrg	/* 43 */ KEY_Comma,
750ee3138f1Smrg	/* 44 */ KEY_Slash,
751ee3138f1Smrg	/* 45 */ KEY_N,
752ee3138f1Smrg	/* 46 */ KEY_M,
753ee3138f1Smrg	/* 47 */ KEY_Period,
754ee3138f1Smrg	/* 48 */ KEY_Tab,
755ee3138f1Smrg	/* 49 */ KEY_Space,
756ee3138f1Smrg	/* 50 */ KEY_Tilde,
757ac15d2bcSmacallan	/* 51 */ KEY_BackSpace,
758ee3138f1Smrg	/* 52 */ KEY_AltLang,
759ee3138f1Smrg	/* 53 */ KEY_Escape,
760ee3138f1Smrg	/* 54 */ KEY_LCtrl,
761ac15d2bcSmacallan	/* 55 */ KEY_LMeta,
762ee3138f1Smrg	/* 56 */ KEY_ShiftL,
763ee3138f1Smrg	/* 57 */ KEY_CapsLock,
764ac15d2bcSmacallan	/* 58 */ KEY_Alt,
765ee3138f1Smrg	/* 59 */ KEY_Left,
766ee3138f1Smrg	/* 60 */ KEY_Right,
767ee3138f1Smrg	/* 61 */ KEY_Down,
768ee3138f1Smrg	/* 62 */ KEY_Up,
769ee3138f1Smrg	/* 63 */ KEY_UNKNOWN,	/* Fn */
770ee3138f1Smrg	/* 64 */ KEY_NOTUSED,
771ee3138f1Smrg	/* 65 */ KEY_KP_Decimal,
772ee3138f1Smrg	/* 66 */ KEY_NOTUSED,
773ee3138f1Smrg	/* 67 */ KEY_KP_Multiply,
774ee3138f1Smrg	/* 68 */ KEY_NOTUSED,
775ee3138f1Smrg	/* 69 */ KEY_KP_Plus,
776ee3138f1Smrg	/* 70 */ KEY_NOTUSED,
777ac15d2bcSmacallan	/* 71 */ KEY_NumLock,	/* Clear */
778ee3138f1Smrg	/* 72 */ KEY_NOTUSED,
779ee3138f1Smrg	/* 73 */ KEY_NOTUSED,
780ee3138f1Smrg	/* 74 */ KEY_NOTUSED,
781ee3138f1Smrg	/* 75 */ KEY_KP_Divide,
782ee3138f1Smrg	/* 76 */ KEY_KP_Enter,
783ee3138f1Smrg	/* 77 */ KEY_NOTUSED,
784ee3138f1Smrg	/* 78 */ KEY_KP_Minus,
785ee3138f1Smrg	/* 79 */ KEY_NOTUSED,
786ee3138f1Smrg	/* 80 */ KEY_NOTUSED,
787ee3138f1Smrg	/* 81 */ KEY_KP_Equal,	/* Keypad = */
788ee3138f1Smrg	/* 82 */ KEY_KP_0,
789ee3138f1Smrg	/* 83 */ KEY_KP_1,
790ee3138f1Smrg	/* 84 */ KEY_KP_2,
791ee3138f1Smrg	/* 85 */ KEY_KP_3,
792ee3138f1Smrg	/* 86 */ KEY_KP_4,
793ee3138f1Smrg	/* 87 */ KEY_KP_5,
794ee3138f1Smrg	/* 88 */ KEY_KP_6,
795ee3138f1Smrg	/* 89 */ KEY_KP_7,
796ee3138f1Smrg	/* 90 */ KEY_NOTUSED,
797ee3138f1Smrg	/* 91 */ KEY_KP_8,
798ee3138f1Smrg	/* 92 */ KEY_KP_9,
799ee3138f1Smrg	/* 93 */ KEY_NOTUSED,
800ee3138f1Smrg	/* 94 */ KEY_NOTUSED,
801ac15d2bcSmacallan	/* 95 */ KEY_KP_Decimal,	/* Keypad ,  */
802ee3138f1Smrg	/* 96 */ KEY_F5,
803ee3138f1Smrg	/* 97 */ KEY_F6,
804ee3138f1Smrg	/* 98 */ KEY_F7,
805ee3138f1Smrg	/* 99 */ KEY_F3,
806ee3138f1Smrg	/* 100 */ KEY_F8,
807ee3138f1Smrg	/* 101 */ KEY_F9,
808ee3138f1Smrg	/* 102 */ KEY_NOTUSED,
809ee3138f1Smrg	/* 103 */ KEY_F11,
810ee3138f1Smrg	/* 104 */ KEY_NOTUSED,
811ac15d2bcSmacallan	/* 105 */ KEY_Print,
812ee3138f1Smrg	/* 106 */ KEY_KP_Enter,
813ac15d2bcSmacallan	/* 107 */ KEY_ScrollLock,
814ee3138f1Smrg	/* 108 */ KEY_NOTUSED,
815ee3138f1Smrg	/* 109 */ KEY_F10,
816ee3138f1Smrg	/* 110 */ KEY_NOTUSED,
817ee3138f1Smrg	/* 111 */ KEY_F12,
818ee3138f1Smrg	/* 112 */ KEY_NOTUSED,
819ac15d2bcSmacallan	/* 113 */ KEY_Pause,
820ac15d2bcSmacallan	/* 114 */ KEY_Insert,
821ee3138f1Smrg	/* 115 */ KEY_Home,
822ee3138f1Smrg	/* 116 */ KEY_PgUp,
823ac15d2bcSmacallan	/* 117 */ KEY_Delete,
824ee3138f1Smrg	/* 118 */ KEY_F4,
825ee3138f1Smrg	/* 119 */ KEY_End,
826ee3138f1Smrg	/* 120 */ KEY_F2,
827ee3138f1Smrg	/* 121 */ KEY_PgDown,
828ac15d2bcSmacallan	/* 122 */ KEY_F1,
829ac15d2bcSmacallan	/* 123 */ KEY_NOTUSED,
830ac15d2bcSmacallan	/* 124 */ KEY_NOTUSED,
831ac15d2bcSmacallan	/* 125 */ KEY_NOTUSED,
832ac15d2bcSmacallan	/* 126 */ KEY_NOTUSED,
833ac15d2bcSmacallan	/* 127 */ KEY_Power
834ee3138f1Smrg};
835aa8e367bSmrg#define WS_ADB_MAP_SIZE (sizeof(wsAdbMap)/sizeof(*wsAdbMap))
836ee3138f1Smrg
837ee3138f1Smrgstatic
838ee3138f1SmrgTransMapRec wsAdb = {
839ee3138f1Smrg    0,
840ee3138f1Smrg    WS_ADB_MAP_SIZE,
841ee3138f1Smrg    wsAdbMap
842ee3138f1Smrg};
843ee3138f1Smrg
8440eaa3919Sphx/* Map for amiga keyboards  */
8450eaa3919Sphxstatic CARD8 wsAmigaMap[] = {
8460eaa3919Sphx	/* 0 */ KEY_Tilde,
8470eaa3919Sphx	/* 1 */ KEY_1,
8480eaa3919Sphx	/* 2 */ KEY_2,
8490eaa3919Sphx	/* 3 */ KEY_3,
8500eaa3919Sphx	/* 4 */ KEY_4,
8510eaa3919Sphx	/* 5 */ KEY_5,
8520eaa3919Sphx	/* 6 */ KEY_6,
8530eaa3919Sphx	/* 7 */ KEY_7,
8540eaa3919Sphx	/* 8 */ KEY_8,
8550eaa3919Sphx	/* 9 */ KEY_9,
8560eaa3919Sphx	/* 10 */ KEY_0,
8570eaa3919Sphx	/* 11 */ KEY_Minus,
8580eaa3919Sphx	/* 12 */ KEY_Equal,
8590eaa3919Sphx	/* 13 */ KEY_BSlash,	/* key in this position only on Amiga */
8600eaa3919Sphx	/* 14 */ KEY_NOTUSED,
8610eaa3919Sphx	/* 15 */ KEY_KP_0,
8620eaa3919Sphx	/* 16 */ KEY_Q,
8630eaa3919Sphx	/* 17 */ KEY_W,
8640eaa3919Sphx	/* 18 */ KEY_E,
8650eaa3919Sphx	/* 19 */ KEY_R,
8660eaa3919Sphx	/* 20 */ KEY_T,
8670eaa3919Sphx	/* 21 */ KEY_Y,
8680eaa3919Sphx	/* 22 */ KEY_U,
8690eaa3919Sphx	/* 23 */ KEY_I,
8700eaa3919Sphx	/* 24 */ KEY_O,
8710eaa3919Sphx	/* 25 */ KEY_P,
8720eaa3919Sphx	/* 26 */ KEY_LBrace,
8730eaa3919Sphx	/* 27 */ KEY_RBrace,
8740eaa3919Sphx	/* 28 */ KEY_NOTUSED,
8750eaa3919Sphx	/* 29 */ KEY_KP_1,
8760eaa3919Sphx	/* 30 */ KEY_KP_2,
8770eaa3919Sphx	/* 31 */ KEY_KP_3,
8780eaa3919Sphx	/* 32 */ KEY_A,
8790eaa3919Sphx	/* 33 */ KEY_S,
8800eaa3919Sphx	/* 34 */ KEY_D,
8810eaa3919Sphx	/* 35 */ KEY_F,
8820eaa3919Sphx	/* 36 */ KEY_G,
8830eaa3919Sphx	/* 37 */ KEY_H,
8840eaa3919Sphx	/* 38 */ KEY_J,
8850eaa3919Sphx	/* 39 */ KEY_K,
8860eaa3919Sphx	/* 40 */ KEY_L,
8870eaa3919Sphx	/* 41 */ KEY_SemiColon,
8880eaa3919Sphx	/* 42 */ KEY_Quote,
8890eaa3919Sphx	/* 43 */ KEY_BSlash,	/* # on international keyboards */
8900eaa3919Sphx	/* 44 */ KEY_NOTUSED,
8910eaa3919Sphx	/* 45 */ KEY_KP_4,
8920eaa3919Sphx	/* 46 */ KEY_KP_5,
8930eaa3919Sphx	/* 47 */ KEY_KP_6,
8940eaa3919Sphx	/* 48 */ KEY_Less,
8950eaa3919Sphx	/* 49 */ KEY_Z,
8960eaa3919Sphx	/* 50 */ KEY_X,
8970eaa3919Sphx	/* 51 */ KEY_C,
8980eaa3919Sphx	/* 52 */ KEY_V,
8990eaa3919Sphx	/* 53 */ KEY_B,
9000eaa3919Sphx	/* 54 */ KEY_N,
9010eaa3919Sphx	/* 55 */ KEY_M,
9020eaa3919Sphx	/* 56 */ KEY_Comma,
9030eaa3919Sphx	/* 57 */ KEY_Period,
9040eaa3919Sphx	/* 58 */ KEY_Slash,
9050eaa3919Sphx	/* 59 */ KEY_NOTUSED,
9060eaa3919Sphx	/* 60 */ KEY_KP_Decimal,
9070eaa3919Sphx	/* 61 */ KEY_KP_7,
9080eaa3919Sphx	/* 62 */ KEY_KP_8,
9090eaa3919Sphx	/* 63 */ KEY_KP_9,
9100eaa3919Sphx	/* 64 */ KEY_Space,
9110eaa3919Sphx	/* 65 */ KEY_BackSpace,
9120eaa3919Sphx	/* 66 */ KEY_Tab,
9130eaa3919Sphx	/* 67 */ KEY_KP_Enter,
9140eaa3919Sphx	/* 68 */ KEY_Enter,
9150eaa3919Sphx	/* 69 */ KEY_Escape,
9160eaa3919Sphx	/* 70 */ KEY_Delete,
9170eaa3919Sphx	/* 71 */ KEY_NOTUSED,
9180eaa3919Sphx	/* 72 */ KEY_NOTUSED,
9190eaa3919Sphx	/* 73 */ KEY_NOTUSED,
9200eaa3919Sphx	/* 74 */ KEY_KP_Minus,
9210eaa3919Sphx	/* 75 */ KEY_NOTUSED,
9220eaa3919Sphx	/* 76 */ KEY_Up,
9230eaa3919Sphx	/* 77 */ KEY_Down,
9240eaa3919Sphx	/* 78 */ KEY_Right,
9250eaa3919Sphx	/* 79 */ KEY_Left,
9260eaa3919Sphx	/* 80 */ KEY_F1,
9270eaa3919Sphx	/* 81 */ KEY_F2,
9280eaa3919Sphx	/* 82 */ KEY_F3,
9290eaa3919Sphx	/* 83 */ KEY_F4,
9300eaa3919Sphx	/* 84 */ KEY_F5,
9310eaa3919Sphx	/* 85 */ KEY_F6,
9320eaa3919Sphx	/* 86 */ KEY_F7,
9330eaa3919Sphx	/* 87 */ KEY_F8,
9340eaa3919Sphx	/* 88 */ KEY_F9,
9350eaa3919Sphx	/* 89 */ KEY_F10,
9360eaa3919Sphx	/* 90 */ KEY_UNKNOWN,		/* Keypad [ */
9370eaa3919Sphx	/* 91 */ KEY_UNKNOWN,		/* Keypad ] */
9380eaa3919Sphx	/* 92 */ KEY_KP_Divide,
9390eaa3919Sphx	/* 93 */ KEY_KP_Multiply,
9400eaa3919Sphx	/* 94 */ KEY_KP_Plus,
9410eaa3919Sphx	/* 95 */ KEY_Help,
9420eaa3919Sphx	/* 96 */ KEY_ShiftL,
9430eaa3919Sphx	/* 97 */ KEY_ShiftR,
9440eaa3919Sphx	/* 98 */ KEY_NOTUSED,
9450eaa3919Sphx	/* 99 */ KEY_LCtrl,
9460eaa3919Sphx	/* 100 */ KEY_Alt,
9470eaa3919Sphx	/* 101 */ KEY_AltLang,
9480eaa3919Sphx	/* 102 */ KEY_LMeta,
9490eaa3919Sphx	/* 103 */ KEY_RMeta
9500eaa3919Sphx};
9510eaa3919Sphx#define WS_AMIGA_MAP_SIZE (sizeof(wsAmigaMap)/sizeof(*wsAmigaMap))
9520eaa3919Sphx
9530eaa3919Sphxstatic
9540eaa3919SphxTransMapRec wsAmiga = {
9550eaa3919Sphx    0,
9560eaa3919Sphx    WS_AMIGA_MAP_SIZE,
9570eaa3919Sphx    wsAmigaMap
9580eaa3919Sphx};
9590eaa3919Sphx
9600c005ca7Sabs/* Map for LK201 keyboards  */
9610c005ca7Sabsstatic CARD8 wsLk201Map[] = {
9620c005ca7Sabs	/* 0 */ KEY_F1,
9630c005ca7Sabs	/* 1 */ KEY_F2,
9640c005ca7Sabs	/* 2 */ KEY_F3,
9650c005ca7Sabs	/* 3 */ KEY_F4,
9660c005ca7Sabs	/* 4 */ KEY_F5,
9670c005ca7Sabs	/* 5 */ KEY_NOTUSED,
9680c005ca7Sabs	/* 6 */ KEY_NOTUSED,
9690c005ca7Sabs	/* 7 */ KEY_NOTUSED,
9700c005ca7Sabs	/* 8 */ KEY_NOTUSED,
9710c005ca7Sabs	/* 9 */ KEY_NOTUSED,
9720c005ca7Sabs	/* 10 */ KEY_NOTUSED,
9730c005ca7Sabs	/* 11 */ KEY_NOTUSED,
9740c005ca7Sabs	/* 12 */ KEY_NOTUSED,
9750c005ca7Sabs	/* 13 */ KEY_NOTUSED,
9760c005ca7Sabs	/* 14 */ KEY_F6,
9770c005ca7Sabs	/* 15 */ KEY_F7,
9780c005ca7Sabs	/* 16 */ KEY_F8,
9790c005ca7Sabs	/* 17 */ KEY_F9,
9800c005ca7Sabs	/* 18 */ KEY_F10,
9810c005ca7Sabs	/* 19 */ KEY_NOTUSED,
9820c005ca7Sabs	/* 20 */ KEY_NOTUSED,
9830c005ca7Sabs	/* 21 */ KEY_NOTUSED,
9840c005ca7Sabs	/* 22 */ KEY_NOTUSED,
9850c005ca7Sabs	/* 23 */ KEY_NOTUSED,
9860c005ca7Sabs	/* 24 */ KEY_NOTUSED,
9870c005ca7Sabs	/* 25 */ KEY_NOTUSED,
9880c005ca7Sabs	/* 26 */ KEY_NOTUSED,
9890c005ca7Sabs	/* 27 */ KEY_F11,
9900c005ca7Sabs	/* 28 */ KEY_F12,
9910c005ca7Sabs	/* 29 */ KEY_F13,
9920c005ca7Sabs	/* 30 */ KEY_F14,
9930c005ca7Sabs	/* 31 */ KEY_NOTUSED,
9940c005ca7Sabs	/* 32 */ KEY_NOTUSED,
9950c005ca7Sabs	/* 33 */ KEY_NOTUSED,
9960c005ca7Sabs	/* 34 */ KEY_NOTUSED,
9970c005ca7Sabs	/* 35 */ KEY_NOTUSED,
9980c005ca7Sabs	/* 36 */ KEY_NOTUSED,
9990c005ca7Sabs	/* 37 */ KEY_NOTUSED,
10000c005ca7Sabs	/* 38 */ KEY_Help,
10010c005ca7Sabs	/* 39 */ KEY_F16,	/* Do */
10020c005ca7Sabs	/* 40 */ KEY_NOTUSED,
10030c005ca7Sabs	/* 41 */ KEY_NOTUSED,
10040c005ca7Sabs	/* 42 */ KEY_F17,
10050c005ca7Sabs	/* 43 */ KEY_L8,	/* F18 */
10060c005ca7Sabs	/* 44 */ KEY_L9,	/* F19 */
10070c005ca7Sabs	/* 45 */ KEY_L10,	/* F20 */
10080c005ca7Sabs	/* 46 */ KEY_NOTUSED,
10090c005ca7Sabs	/* 47 */ KEY_NOTUSED,
10100c005ca7Sabs	/* 48 */ KEY_NOTUSED,
10110c005ca7Sabs	/* 49 */ KEY_NOTUSED,
10120c005ca7Sabs	/* 50 */ KEY_NOTUSED,
10130c005ca7Sabs	/* 51 */ KEY_NOTUSED,
10140c005ca7Sabs	/* 52 */ KEY_Home,	/* Find */
10150c005ca7Sabs	/* 53 */ KEY_Insert,	/* Insert Here */
10160c005ca7Sabs	/* 54 */ KEY_Delete,	/* Re-move */
10170c005ca7Sabs	/* 55 */ KEY_End,	/* Select */
10180c005ca7Sabs	/* 56 */ KEY_PgUp,	/* Prev-Screen */
10190c005ca7Sabs	/* 57 */ KEY_PgDown,	/* Next-Screen */
10200c005ca7Sabs	/* 58 */ KEY_NOTUSED,
10210c005ca7Sabs	/* 59 */ KEY_NOTUSED,
10220c005ca7Sabs	/* 60 */ KEY_KP_0,
10230c005ca7Sabs	/* 61 */ KEY_NOTUSED,
10240c005ca7Sabs	/* 62 */ KEY_KP_Decimal,
10250c005ca7Sabs	/* 63 */ KEY_KP_Enter,
10260c005ca7Sabs	/* 64 */ KEY_KP_1,
10270c005ca7Sabs	/* 65 */ KEY_KP_2,
10280c005ca7Sabs	/* 66 */ KEY_KP_3,
10290c005ca7Sabs	/* 67 */ KEY_KP_4,
10300c005ca7Sabs	/* 68 */ KEY_KP_5,
10310c005ca7Sabs	/* 69 */ KEY_KP_6,
10320c005ca7Sabs	/* 70 */ KEY_KP_Plus,	/* KP Comma */
10330c005ca7Sabs	/* 71 */ KEY_KP_7,
10340c005ca7Sabs	/* 72 */ KEY_KP_8,
10350c005ca7Sabs	/* 73 */ KEY_KP_9,
10360c005ca7Sabs	/* 74 */ KEY_KP_Minus,
10370c005ca7Sabs	/* 75 */ KEY_L1,	/* PF1 */
10380c005ca7Sabs	/* 76 */ KEY_L2,	/* PF2 */
10390c005ca7Sabs	/* 77 */ KEY_L3,	/* PF3 */
10400c005ca7Sabs	/* 78 */ KEY_L4,	/* PF4 */
10410c005ca7Sabs	/* 79 */ KEY_NOTUSED,
10420c005ca7Sabs	/* 80 */ KEY_NOTUSED,
10430c005ca7Sabs	/* 81 */ KEY_Left,
10440c005ca7Sabs	/* 82 */ KEY_Right,
10450c005ca7Sabs	/* 83 */ KEY_Down,
10460c005ca7Sabs	/* 84 */ KEY_Up,
10470c005ca7Sabs	/* 85 */ KEY_NOTUSED,
10480c005ca7Sabs	/* 86 */ KEY_NOTUSED,
10490c005ca7Sabs	/* 87 */ KEY_NOTUSED,
10500c005ca7Sabs	/* 88 */ KEY_ShiftL,
10510c005ca7Sabs	/* 89 */ KEY_LCtrl,
10520c005ca7Sabs	/* 90 */ KEY_CapsLock,
10530c005ca7Sabs	/* 91 */ KEY_Alt, 	/* Compose */
10540c005ca7Sabs	/* 92 */ KEY_NOTUSED,
10550c005ca7Sabs	/* 93 */ KEY_NOTUSED,
10560c005ca7Sabs	/* 94 */ KEY_NOTUSED,
10570c005ca7Sabs	/* 95 */ KEY_NOTUSED,
10580c005ca7Sabs	/* 96 */ KEY_NOTUSED,
10590c005ca7Sabs	/* 97 */ KEY_NOTUSED,
10600c005ca7Sabs	/* 98 */ KEY_NOTUSED,
10610c005ca7Sabs	/* 99 */ KEY_NOTUSED,
10620c005ca7Sabs	/* 100 */ KEY_NOTUSED,
10630c005ca7Sabs	/* 101 */ KEY_NOTUSED,
10640c005ca7Sabs	/* 102 */ KEY_Delete,
10650c005ca7Sabs	/* 103 */ KEY_Enter,
10660c005ca7Sabs	/* 104 */ KEY_Tab,
10670c005ca7Sabs	/* 105 */ KEY_Escape, /* tilde */
10680c005ca7Sabs	/* 106 */ KEY_1,
10690c005ca7Sabs	/* 107 */ KEY_Q,
10700c005ca7Sabs	/* 108 */ KEY_A,
10710c005ca7Sabs	/* 109 */ KEY_Z,
10720c005ca7Sabs	/* 110 */ KEY_NOTUSED,
10730c005ca7Sabs	/* 111 */ KEY_2,
10740c005ca7Sabs	/* 112 */ KEY_W,
10750c005ca7Sabs	/* 113 */ KEY_S,
10760c005ca7Sabs	/* 114 */ KEY_X,
10770c005ca7Sabs	/* 115 */ KEY_Less,
10780c005ca7Sabs	/* 116 */ KEY_NOTUSED,
10790c005ca7Sabs	/* 117 */ KEY_3,
10800c005ca7Sabs	/* 118 */ KEY_E,
10810c005ca7Sabs	/* 119 */ KEY_D,
10820c005ca7Sabs	/* 120 */ KEY_C,
10830c005ca7Sabs	/* 121 */ KEY_NOTUSED,
10840c005ca7Sabs	/* 122 */ KEY_4,
10850c005ca7Sabs	/* 123 */ KEY_R,
10860c005ca7Sabs	/* 124 */ KEY_F,
10870c005ca7Sabs	/* 125 */ KEY_V,
10880c005ca7Sabs	/* 126 */ KEY_Space,
10890c005ca7Sabs	/* 127 */ KEY_NOTUSED,
10900c005ca7Sabs	/* 128 */ KEY_5,
10910c005ca7Sabs	/* 129 */ KEY_T,
10920c005ca7Sabs	/* 130 */ KEY_G,
10930c005ca7Sabs	/* 131 */ KEY_B,
10940c005ca7Sabs	/* 132 */ KEY_NOTUSED,
10950c005ca7Sabs	/* 133 */ KEY_6,
10960c005ca7Sabs	/* 134 */ KEY_Y,
10970c005ca7Sabs	/* 135 */ KEY_H,
10980c005ca7Sabs	/* 136 */ KEY_N,
10990c005ca7Sabs	/* 137 */ KEY_NOTUSED,
11000c005ca7Sabs	/* 138 */ KEY_7,
11010c005ca7Sabs	/* 139 */ KEY_U,
11020c005ca7Sabs	/* 140 */ KEY_J,
11030c005ca7Sabs	/* 141 */ KEY_M,
11040c005ca7Sabs	/* 142 */ KEY_NOTUSED,
11050c005ca7Sabs	/* 143 */ KEY_8,
11060c005ca7Sabs	/* 144 */ KEY_I,
11070c005ca7Sabs	/* 145 */ KEY_K,
11080c005ca7Sabs	/* 146 */ KEY_Comma,
11090c005ca7Sabs	/* 147 */ KEY_NOTUSED,
11100c005ca7Sabs	/* 148 */ KEY_9,
11110c005ca7Sabs	/* 149 */ KEY_O,
11120c005ca7Sabs	/* 150 */ KEY_L,
11130c005ca7Sabs	/* 151 */ KEY_Period,
11140c005ca7Sabs	/* 152 */ KEY_NOTUSED,
11150c005ca7Sabs	/* 153 */ KEY_0,
11160c005ca7Sabs	/* 154 */ KEY_P,
11170c005ca7Sabs	/* 155 */ KEY_NOTUSED,
11180c005ca7Sabs	/* 156 */ KEY_SemiColon,
11190c005ca7Sabs	/* 157 */ KEY_Slash,
11200c005ca7Sabs	/* 158 */ KEY_NOTUSED,
11210c005ca7Sabs	/* 159 */ KEY_Equal,
11220c005ca7Sabs	/* 160 */ KEY_RBrace,
11230c005ca7Sabs	/* 161 */ KEY_BSlash,
11240c005ca7Sabs	/* 162 */ KEY_NOTUSED,
11250c005ca7Sabs	/* 163 */ KEY_Minus,
11260c005ca7Sabs	/* 164 */ KEY_LBrace,
11270c005ca7Sabs	/* 165 */ KEY_Quote,
11280c005ca7Sabs	/* 166 */ KEY_NOTUSED,
11290c005ca7Sabs	/* 167 */ KEY_NOTUSED,
11300c005ca7Sabs	/* 168 */ KEY_NOTUSED,
11310c005ca7Sabs	/* 169 */ KEY_NOTUSED,
11320c005ca7Sabs	/* 170 */ KEY_NOTUSED,
11330c005ca7Sabs	/* 171 */ KEY_NOTUSED,
11340c005ca7Sabs	/* 172 */ KEY_NOTUSED,
11350c005ca7Sabs	/* 173 */ KEY_NOTUSED,
11360c005ca7Sabs	/* 174 */ KEY_NOTUSED,
11370c005ca7Sabs	/* 175 */ KEY_NOTUSED,
11380c005ca7Sabs	/* 176 */ KEY_NOTUSED,
11390c005ca7Sabs	/* 177 */ KEY_NOTUSED,
11400c005ca7Sabs	/* 178 */ KEY_NOTUSED,
11410c005ca7Sabs	/* 179 */ KEY_NOTUSED,
11420c005ca7Sabs	/* 180 */ KEY_NOTUSED,
11430c005ca7Sabs	/* 181 */ KEY_NOTUSED,
11440c005ca7Sabs	/* 182 */ KEY_NOTUSED,
11450c005ca7Sabs	/* 183 */ KEY_NOTUSED,
11460c005ca7Sabs	/* 184 */ KEY_NOTUSED,
11470c005ca7Sabs	/* 185 */ KEY_NOTUSED,
11480c005ca7Sabs	/* 186 */ KEY_NOTUSED,
11490c005ca7Sabs	/* 187 */ KEY_NOTUSED,
11500c005ca7Sabs	/* 188 */ KEY_NOTUSED,
11510c005ca7Sabs	/* 189 */ KEY_NOTUSED,
11520c005ca7Sabs	/* 190 */ KEY_NOTUSED,
11530c005ca7Sabs	/* 191 */ KEY_NOTUSED,
11540c005ca7Sabs	/* 192 */ KEY_NOTUSED,
11550c005ca7Sabs	/* 193 */ KEY_NOTUSED,
11560c005ca7Sabs	/* 194 */ KEY_NOTUSED,
11570c005ca7Sabs	/* 195 */ KEY_NOTUSED,
11580c005ca7Sabs	/* 196 */ KEY_NOTUSED,
11590c005ca7Sabs	/* 197 */ KEY_NOTUSED,
11600c005ca7Sabs	/* 198 */ KEY_NOTUSED,
11610c005ca7Sabs	/* 199 */ KEY_NOTUSED,
11620c005ca7Sabs	/* 200 */ KEY_NOTUSED,
11630c005ca7Sabs	/* 201 */ KEY_NOTUSED,
11640c005ca7Sabs	/* 202 */ KEY_NOTUSED,
11650c005ca7Sabs	/* 203 */ KEY_NOTUSED,
11660c005ca7Sabs	/* 204 */ KEY_NOTUSED,
11670c005ca7Sabs	/* 205 */ KEY_NOTUSED,
11680c005ca7Sabs	/* 206 */ KEY_NOTUSED,
11690c005ca7Sabs	/* 207 */ KEY_NOTUSED,
11700c005ca7Sabs	/* 208 */ KEY_NOTUSED,
11710c005ca7Sabs	/* 209 */ KEY_NOTUSED,
11720c005ca7Sabs	/* 210 */ KEY_NOTUSED,
11730c005ca7Sabs	/* 211 */ KEY_NOTUSED,
11740c005ca7Sabs	/* 212 */ KEY_NOTUSED,
11750c005ca7Sabs	/* 213 */ KEY_NOTUSED,
11760c005ca7Sabs	/* 214 */ KEY_NOTUSED,
11770c005ca7Sabs	/* 215 */ KEY_NOTUSED,
11780c005ca7Sabs	/* 216 */ KEY_NOTUSED,
11790c005ca7Sabs	/* 217 */ KEY_NOTUSED,
11800c005ca7Sabs	/* 218 */ KEY_NOTUSED,
11810c005ca7Sabs	/* 219 */ KEY_NOTUSED,
11820c005ca7Sabs	/* 220 */ KEY_NOTUSED,
11830c005ca7Sabs	/* 221 */ KEY_NOTUSED,
11840c005ca7Sabs	/* 222 */ KEY_NOTUSED,
11850c005ca7Sabs	/* 223 */ KEY_NOTUSED,
11860c005ca7Sabs	/* 224 */ KEY_NOTUSED,
11870c005ca7Sabs	/* 225 */ KEY_NOTUSED,
11880c005ca7Sabs	/* 226 */ KEY_NOTUSED,
11890c005ca7Sabs	/* 227 */ KEY_NOTUSED,
11900c005ca7Sabs	/* 228 */ KEY_NOTUSED,
11910c005ca7Sabs	/* 229 */ KEY_NOTUSED,
11920c005ca7Sabs	/* 230 */ KEY_NOTUSED,
11930c005ca7Sabs	/* 231 */ KEY_NOTUSED,
11940c005ca7Sabs	/* 232 */ KEY_NOTUSED,
11950c005ca7Sabs	/* 233 */ KEY_NOTUSED,
11960c005ca7Sabs	/* 234 */ KEY_NOTUSED,
11970c005ca7Sabs	/* 235 */ KEY_NOTUSED,
11980c005ca7Sabs	/* 236 */ KEY_NOTUSED,
11990c005ca7Sabs	/* 237 */ KEY_NOTUSED,
12000c005ca7Sabs	/* 238 */ KEY_NOTUSED,
12010c005ca7Sabs	/* 239 */ KEY_NOTUSED,
12020c005ca7Sabs	/* 240 */ KEY_NOTUSED,
12030c005ca7Sabs	/* 241 */ KEY_NOTUSED,
12040c005ca7Sabs	/* 242 */ KEY_NOTUSED,
12050c005ca7Sabs	/* 243 */ KEY_NOTUSED,
12060c005ca7Sabs	/* 244 */ KEY_NOTUSED,
12070c005ca7Sabs	/* 245 */ KEY_NOTUSED,
12080c005ca7Sabs	/* 246 */ KEY_NOTUSED,
12090c005ca7Sabs	/* 247 */ KEY_NOTUSED,
12100c005ca7Sabs	/* 248 */ KEY_NOTUSED,
12110c005ca7Sabs	/* 249 */ KEY_NOTUSED,
12120c005ca7Sabs	/* 250 */ KEY_NOTUSED,
12130c005ca7Sabs	/* 251 */ KEY_NOTUSED,
12140c005ca7Sabs};
1215aa8e367bSmrg#define WS_LK201_MAP_SIZE (sizeof(wsLk201Map)/sizeof(*wsLk201Map))
12160c005ca7Sabs
12170c005ca7Sabsstatic
12180c005ca7SabsTransMapRec wsLk201 = {
12190c005ca7Sabs    0,
12200c005ca7Sabs    WS_LK201_MAP_SIZE,
12210c005ca7Sabs    wsLk201Map
12220c005ca7Sabs};
12230c005ca7Sabs
1224ee3138f1Smrgstatic CARD8 wsSunMap[] = {
1225ee3138f1Smrg	/* 0x00 */ KEY_Help,
1226ee3138f1Smrg	/* 0x01 */ KEY_L1,		/* stop */
1227ee3138f1Smrg	/* 0x02 */ KEY_AudioLower,	/* BrightnessDown / S-VolumeDown */
1228ee3138f1Smrg	/* 0x03 */ KEY_L2,		/* again */
1229f5a99ab6Smacallan	/* 0x04 */ KEY_AudioRaise,	/* BrightnessUp / S-VolumeUp */
1230ee3138f1Smrg	/* 0x05 */ KEY_F1,
1231ee3138f1Smrg	/* 0x06 */ KEY_F2,
1232ee3138f1Smrg	/* 0x07 */ KEY_F10,
1233ee3138f1Smrg	/* 0x08 */ KEY_F3,
1234ee3138f1Smrg	/* 0x09 */ KEY_F11,
1235ee3138f1Smrg	/* 0x0a */ KEY_F4,
1236ee3138f1Smrg	/* 0x0b */ KEY_F12,
1237ee3138f1Smrg	/* 0x0c */ KEY_F5,
1238ee3138f1Smrg	/* 0x0d */ KEY_AltLang,
1239ee3138f1Smrg	/* 0x0e */ KEY_F6,
1240ee3138f1Smrg	/* 0x0f */ KEY_NOTUSED,
1241ee3138f1Smrg	/* 0x10 */ KEY_F7,
1242ee3138f1Smrg	/* 0x11 */ KEY_F8,
1243ee3138f1Smrg	/* 0x12 */ KEY_F9,
1244ee3138f1Smrg	/* 0x13 */ KEY_Alt,
1245ee3138f1Smrg	/* 0x14 */ KEY_Up,
1246ee3138f1Smrg	/* 0x15 */ KEY_Pause,
1247ee3138f1Smrg	/* 0x16 */ KEY_Print,
1248ee3138f1Smrg	/* 0x17 */ KEY_ScrollLock,
1249ee3138f1Smrg	/* 0x18 */ KEY_Left,
1250ee3138f1Smrg	/* 0x19 */ KEY_L3,		/* props */
1251ee3138f1Smrg	/* 0x1a */ KEY_L4,		/* undo */
1252ee3138f1Smrg	/* 0x1b */ KEY_Down,
1253ee3138f1Smrg	/* 0x1c */ KEY_Right,
1254ee3138f1Smrg	/* 0x1d */ KEY_Escape,
1255ee3138f1Smrg	/* 0x1e */ KEY_1,
1256ee3138f1Smrg	/* 0x1f */ KEY_2,
1257ee3138f1Smrg	/* 0x20 */ KEY_3,
1258ee3138f1Smrg	/* 0x21 */ KEY_4,
1259ee3138f1Smrg	/* 0x22 */ KEY_5,
1260ee3138f1Smrg	/* 0x23 */ KEY_6,
1261ee3138f1Smrg	/* 0x24 */ KEY_7,
1262ee3138f1Smrg	/* 0x25 */ KEY_8,
1263ee3138f1Smrg	/* 0x26 */ KEY_9,
1264ee3138f1Smrg	/* 0x27 */ KEY_0,
1265ee3138f1Smrg	/* 0x28 */ KEY_Minus,
1266ee3138f1Smrg	/* 0x29 */ KEY_Equal,
1267ee3138f1Smrg	/* 0x2a */ KEY_Tilde,
1268ee3138f1Smrg	/* 0x2b */ KEY_BackSpace,
1269ee3138f1Smrg	/* 0x2c */ KEY_Insert,
1270ee3138f1Smrg	/* 0x2d */ KEY_Mute,		/* Audio Mute */
1271ee3138f1Smrg	/* 0x2e */ KEY_KP_Divide,
1272ee3138f1Smrg	/* 0x2f */ KEY_KP_Multiply,
1273ac15d2bcSmacallan	/* 0x30 */ KEY_Power,
1274ee3138f1Smrg	/* 0x31 */ KEY_L5,		/* front */
1275ee3138f1Smrg	/* 0x32 */ KEY_KP_Decimal,
1276ee3138f1Smrg	/* 0x33 */ KEY_L6,		/* copy */
1277ee3138f1Smrg	/* 0x34 */ KEY_Home,
1278ee3138f1Smrg	/* 0x35 */ KEY_Tab,
1279ee3138f1Smrg	/* 0x36 */ KEY_Q,
1280ee3138f1Smrg	/* 0x37 */ KEY_W,
1281ee3138f1Smrg	/* 0x38 */ KEY_E,
1282ee3138f1Smrg	/* 0x39 */ KEY_R,
1283ee3138f1Smrg	/* 0x3a */ KEY_T,
1284ee3138f1Smrg	/* 0x3b */ KEY_Y,
1285ee3138f1Smrg	/* 0x3c */ KEY_U,
1286ee3138f1Smrg	/* 0x3d */ KEY_I,
1287ee3138f1Smrg	/* 0x3e */ KEY_O,
1288ee3138f1Smrg	/* 0x3f */ KEY_P,
1289ee3138f1Smrg	/* 0x40 */ KEY_LBrace,
1290ee3138f1Smrg	/* 0x41 */ KEY_RBrace,
1291ee3138f1Smrg	/* 0x42 */ KEY_Delete,
1292ee3138f1Smrg	/* 0x43 */ KEY_Menu,		/* compose */
1293ee3138f1Smrg	/* 0x44 */ KEY_KP_7,
1294ee3138f1Smrg	/* 0x45 */ KEY_KP_8,
1295ee3138f1Smrg	/* 0x46 */ KEY_KP_9,
1296ee3138f1Smrg	/* 0x47 */ KEY_KP_Minus,
1297ee3138f1Smrg	/* 0x48 */ KEY_L7,		/* open */
1298ee3138f1Smrg	/* 0x49 */ KEY_L8,		/* paste */
1299ee3138f1Smrg	/* 0x4a */ KEY_End,
1300ee3138f1Smrg	/* 0x4b */ KEY_NOTUSED,
1301ee3138f1Smrg	/* 0x4c */ KEY_LCtrl,
1302ee3138f1Smrg	/* 0x4d */ KEY_A,
1303ee3138f1Smrg	/* 0x4e */ KEY_S,
1304ee3138f1Smrg	/* 0x4f */ KEY_D,
1305ee3138f1Smrg	/* 0x50 */ KEY_F,
1306ee3138f1Smrg	/* 0x51 */ KEY_G,
1307ee3138f1Smrg	/* 0x52 */ KEY_H,
1308ee3138f1Smrg	/* 0x53 */ KEY_J,
1309ee3138f1Smrg	/* 0x54 */ KEY_K,
1310ee3138f1Smrg	/* 0x55 */ KEY_L,
1311ee3138f1Smrg	/* 0x56 */ KEY_SemiColon,
1312ee3138f1Smrg	/* 0x57 */ KEY_Quote,
1313ee3138f1Smrg	/* 0x58 */ KEY_BSlash,
1314ee3138f1Smrg	/* 0x59 */ KEY_Enter,
1315ee3138f1Smrg	/* 0x5a */ KEY_KP_Enter,
1316ee3138f1Smrg	/* 0x5b */ KEY_KP_4,
1317ee3138f1Smrg	/* 0x5c */ KEY_KP_5,
1318ee3138f1Smrg	/* 0x5d */ KEY_KP_6,
1319ee3138f1Smrg	/* 0x5e */ KEY_KP_0,
1320ee3138f1Smrg	/* 0x5f */ KEY_L9,		/* find */
1321ee3138f1Smrg	/* 0x60 */ KEY_PgUp,
1322ee3138f1Smrg	/* 0x61 */ KEY_L10,		/* cut */
1323ee3138f1Smrg	/* 0x62 */ KEY_NumLock,
1324ee3138f1Smrg	/* 0x63 */ KEY_ShiftL,
1325ee3138f1Smrg	/* 0x64 */ KEY_Z,
1326ee3138f1Smrg	/* 0x65 */ KEY_X,
1327ee3138f1Smrg	/* 0x66 */ KEY_C,
1328ee3138f1Smrg	/* 0x67 */ KEY_V,
1329ee3138f1Smrg	/* 0x68 */ KEY_B,
1330ee3138f1Smrg	/* 0x69 */ KEY_N,
1331ee3138f1Smrg	/* 0x6a */ KEY_M,
1332ee3138f1Smrg	/* 0x6b */ KEY_Comma,
1333ee3138f1Smrg	/* 0x6c */ KEY_Period,
1334ee3138f1Smrg	/* 0x6d */ KEY_Slash,
1335ee3138f1Smrg	/* 0x6e */ KEY_ShiftR,
1336ee3138f1Smrg	/* 0x6f */ KEY_NOTUSED,		/* linefeed */
1337ee3138f1Smrg	/* 0x70 */ KEY_KP_1,
1338ee3138f1Smrg	/* 0x71 */ KEY_KP_2,
1339ee3138f1Smrg	/* 0x72 */ KEY_KP_3,
1340ee3138f1Smrg	/* 0x73 */ KEY_NOTUSED,
1341ee3138f1Smrg	/* 0x74 */ KEY_NOTUSED,
1342ee3138f1Smrg	/* 0x75 */ KEY_NOTUSED,
1343ac15d2bcSmacallan	/* 0x76 */ KEY_Help,		/* help */
1344ee3138f1Smrg	/* 0x77 */ KEY_CapsLock,
1345ee3138f1Smrg	/* 0x78 */ KEY_LMeta,
1346ee3138f1Smrg	/* 0x79 */ KEY_Space,
1347ee3138f1Smrg	/* 0x7a */ KEY_RMeta,
1348ee3138f1Smrg	/* 0x7b */ KEY_PgDown,
1349ee3138f1Smrg	/* 0x7c */ KEY_Less,		/* < > on some keyboards */
1350ee3138f1Smrg	/* 0x7d */ KEY_KP_Plus,
1351ee3138f1Smrg	/* 0x7e */ KEY_NOTUSED,
1352ee3138f1Smrg	/* 0x7f */ KEY_NOTUSED
1353ee3138f1Smrg};
1354aa8e367bSmrg#define WS_SUN_MAP_SIZE (sizeof(wsSunMap)/sizeof(*wsSunMap))
1355ee3138f1Smrg
1356ee3138f1Smrgstatic
1357ee3138f1SmrgTransMapRec wsSun = {
1358ee3138f1Smrg    0,
1359ee3138f1Smrg    WS_SUN_MAP_SIZE,
1360ee3138f1Smrg    wsSunMap
1361ee3138f1Smrg};
1362ee3138f1Smrg
1363ee3138f1Smrg#endif /* WSCONS_SUPPORT */
1364ee3138f1Smrg
1365ee3138f1Smrg/*ARGSUSED*/
1366ee3138f1Smrg
1367ee3138f1Smrg/*
1368ee3138f1Smrg * KbdGetMapping --
1369ee3138f1Smrg *	Get the national keyboard mapping. The keyboard type is set, a new map
1370ee3138f1Smrg *      and the modifiermap is computed.
1371ee3138f1Smrg */
1372ee3138f1Smrg
1373ee3138f1Smrgvoid
1374ee3138f1SmrgKbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap)
1375ee3138f1Smrg{
1376ee3138f1Smrg  KbdDevPtr pKbd = (KbdDevPtr) pInfo->private;
1377ee3138f1Smrg  KeySym        *k;
1378ee3138f1Smrg  int           i;
1379ee3138f1Smrg
1380ee3138f1Smrg#ifndef __bsdi__
1381ee3138f1Smrg  switch (pKbd->consType) {
1382ee3138f1Smrg
1383ee3138f1Smrg/*
1384ee3138f1Smrg * XXX wscons has no GIO_KEYMAP
1385ee3138f1Smrg */
1386ee3138f1Smrg#if (defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)) && defined(GIO_KEYMAP)
1387ee3138f1Smrg  case SYSCONS:
1388ee3138f1Smrg  case PCVT:
1389ee3138f1Smrg    {
1390ee3138f1Smrg      keymap_t keymap;
1391ee3138f1Smrg
1392ee3138f1Smrg      if (ioctl(pInfo->fd, GIO_KEYMAP, &keymap) != -1) {
1393ee3138f1Smrg	for (i = 0; i < keymap.n_keys && i < NUM_KEYCODES; i++)
1394ee3138f1Smrg	  if (remap[i]) {
1395ee3138f1Smrg	    k = map + (remap[i] << 2);
1396ee3138f1Smrg	    k[0] = KD_GET_ENTRY(i,0);           /* non-shifed */
1397ee3138f1Smrg	    k[1] = KD_GET_ENTRY(i,1);	      /* shifted */
1398ee3138f1Smrg	    k[2] = KD_GET_ENTRY(i,4);	      /* alt */
1399ee3138f1Smrg	    k[3] = KD_GET_ENTRY(i,5);	      /* alt - shifted */
1400ee3138f1Smrg	    if (k[3] == k[2]) k[3] = NoSymbol;
1401ee3138f1Smrg	    if (k[2] == k[1]) k[2] = NoSymbol;
1402ee3138f1Smrg	    if (k[1] == k[0]) k[1] = NoSymbol;
1403ee3138f1Smrg	    if (k[0] == k[2] && k[1] == k[3])
1404ee3138f1Smrg	      k[2] = k[3] = NoSymbol;
1405ee3138f1Smrg	  }
1406ee3138f1Smrg      }
1407ee3138f1Smrg    }
1408ee3138f1Smrg    break;
1409ee3138f1Smrg#endif /* SYSCONS || PCVT */
1410ee3138f1Smrg
1411ee3138f1Smrg  }
1412ee3138f1Smrg#endif /* !bsdi */
1413ee3138f1Smrg
1414ee3138f1Smrg  /*
1415ee3138f1Smrg   * compute the modifier map
1416ee3138f1Smrg   */
1417ee3138f1Smrg  for (i = 0; i < MAP_LENGTH; i++)
1418ee3138f1Smrg    pModMap[i] = NoSymbol;  /* make sure it is restored */
1419ee3138f1Smrg
1420ee3138f1Smrg  for (k = map, i = MIN_KEYCODE;
1421ee3138f1Smrg       i < (NUM_KEYCODES + MIN_KEYCODE);
1422ee3138f1Smrg       i++, k += 4)
1423ee3138f1Smrg
1424ee3138f1Smrg    switch(*k) {
1425ee3138f1Smrg
1426ee3138f1Smrg    case XK_Shift_L:
1427ee3138f1Smrg    case XK_Shift_R:
1428ee3138f1Smrg      pModMap[i] = ShiftMask;
1429ee3138f1Smrg      break;
1430ee3138f1Smrg
1431ee3138f1Smrg    case XK_Control_L:
1432ee3138f1Smrg    case XK_Control_R:
1433ee3138f1Smrg      pModMap[i] = ControlMask;
1434ee3138f1Smrg      break;
1435ee3138f1Smrg
1436ee3138f1Smrg    case XK_Caps_Lock:
1437ee3138f1Smrg      pModMap[i] = LockMask;
1438ee3138f1Smrg      break;
1439ee3138f1Smrg
1440ee3138f1Smrg    case XK_Alt_L:
1441ee3138f1Smrg    case XK_Alt_R:
1442ee3138f1Smrg      pModMap[i] = AltMask;
1443ee3138f1Smrg      break;
1444ee3138f1Smrg
1445ee3138f1Smrg    case XK_Num_Lock:
1446ee3138f1Smrg      pModMap[i] = NumLockMask;
1447ee3138f1Smrg      break;
1448ee3138f1Smrg
1449ee3138f1Smrg    case XK_Scroll_Lock:
1450ee3138f1Smrg      pModMap[i] = ScrollLockMask;
1451ee3138f1Smrg      break;
1452ee3138f1Smrg
1453ee3138f1Smrg      /* kana support */
1454ee3138f1Smrg    case XK_Kana_Lock:
1455ee3138f1Smrg    case XK_Kana_Shift:
1456ee3138f1Smrg      pModMap[i] = KanaMask;
1457ee3138f1Smrg      break;
1458ee3138f1Smrg
1459ee3138f1Smrg      /* alternate toggle for multinational support */
1460ee3138f1Smrg    case XK_Mode_switch:
1461ee3138f1Smrg      pModMap[i] = AltLangMask;
1462ee3138f1Smrg      break;
1463ee3138f1Smrg
1464ee3138f1Smrg    }
1465ee3138f1Smrg
1466ee3138f1Smrg  pKeySyms->map        = map;
1467ee3138f1Smrg  pKeySyms->mapWidth   = GLYPHS_PER_KEY;
1468ee3138f1Smrg  pKeySyms->minKeyCode = MIN_KEYCODE;
1469ee3138f1Smrg  pKeySyms->maxKeyCode = MAX_KEYCODE;
1470ee3138f1Smrg
1471ee3138f1Smrg  switch(pKbd->consType) {
1472ee3138f1Smrg#ifdef SYSCONS_SUPPORT
1473ee3138f1Smrg      case SYSCONS:
1474ee3138f1Smrg           if (pKbd->CustomKeycodes)
1475ee3138f1Smrg              pKbd->scancodeMap = &sysconsCODE;
1476ee3138f1Smrg           else
1477ee3138f1Smrg              pKbd->RemapScanCode = ATScancode;
1478ee3138f1Smrg           break;
1479ee3138f1Smrg#endif
1480ee3138f1Smrg#if defined(PCCONS_SUPPORT) || defined (PCVT_SUPPORT)
1481ee3138f1Smrg      case PCCONS:
1482ee3138f1Smrg      case PCVT:
1483ee3138f1Smrg           pKbd->RemapScanCode = ATScancode;
1484ee3138f1Smrg	   break;
1485ee3138f1Smrg#endif
1486ee3138f1Smrg#ifdef WSCONS_SUPPORT
1487ee3138f1Smrg      case WSCONS:
1488ee3138f1Smrg	if (!pKbd->isConsole) {
1489ee3138f1Smrg           switch (pKbd->wsKbdType) {
1490ee3138f1Smrg	       case WSKBD_TYPE_PC_XT:
1491ee3138f1Smrg	       case WSKBD_TYPE_PC_AT:
1492ac15d2bcSmacallan                    pKbd->scancodeMap = &wsXt;
1493ee3138f1Smrg                    break;
1494ee3138f1Smrg	       case WSKBD_TYPE_USB:
149565174c50Stsutsui#ifdef WSKBD_TYPE_MAPLE
149665174c50Stsutsui	       case WSKBD_TYPE_MAPLE:
149765174c50Stsutsui#endif
1498ee3138f1Smrg                    pKbd->scancodeMap = &wsUsb;
1499ee3138f1Smrg                    break;
1500ee3138f1Smrg#ifdef WSKBD_TYPE_ADB
1501ee3138f1Smrg	       case WSKBD_TYPE_ADB:
1502ee3138f1Smrg                    pKbd->scancodeMap = &wsAdb;
1503ee3138f1Smrg                    break;
1504ee3138f1Smrg#endif
15050eaa3919Sphx#ifdef WSKBD_TYPE_AMIGA
15060eaa3919Sphx	       case WSKBD_TYPE_AMIGA:
15070eaa3919Sphx                    pKbd->scancodeMap = &wsAmiga;
15080eaa3919Sphx                    break;
15090eaa3919Sphx#endif
15100c005ca7Sabs#ifdef WSKBD_TYPE_LK201
15110c005ca7Sabs	       case WSKBD_TYPE_LK201:
1512aa8e367bSmrg                    pKbd->scancodeMap = &wsLk201;
15130c005ca7Sabs                    break;
15140c005ca7Sabs#endif
1515ee3138f1Smrg#ifdef WSKBD_TYPE_SUN
1516ee3138f1Smrg#ifdef WSKBD_TYPE_SUN5
1517ee3138f1Smrg	       case WSKBD_TYPE_SUN5:
1518ee3138f1Smrg#endif
1519ee3138f1Smrg	       case WSKBD_TYPE_SUN:
1520ee3138f1Smrg                    pKbd->scancodeMap = &wsSun;
1521ee3138f1Smrg                    break;
1522ee3138f1Smrg#endif
1523ee3138f1Smrg	       default:
1524ee3138f1Smrg		    ErrorF("Unknown wskbd type %d\n", pKbd->wsKbdType);
1525ee3138f1Smrg           }
1526ee3138f1Smrg	} else {
1527ee3138f1Smrg           pKbd->RemapScanCode = ATScancode;
1528ee3138f1Smrg	}
1529ee3138f1Smrg      break;
1530ee3138f1Smrg#endif
1531ee3138f1Smrg  }
1532ee3138f1Smrg  return;
1533ee3138f1Smrg}
1534