xref: /openbsd-src/sys/dev/sun/sunkbd.c (revision db3296cf5c1dd9058ceecc3a29fe4aaa0bd26000)
1 /*	$OpenBSD: sunkbd.c,v 1.18 2003/06/02 18:59:38 jason Exp $	*/
2 
3 /*
4  * Copyright (c) 2002, 2003 Miodrag Vallat.
5  * Copyright (c) 2002 Jason L. Wright (jason@thought.net)
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
21  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
25  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  *
29  * Effort sponsored in part by the Defense Advanced Research Projects
30  * Agency (DARPA) and Air Force Research Laboratory, Air Force
31  * Materiel Command, USAF, under agreement number F30602-01-2-0537.
32  *
33  */
34 
35 #include <sys/param.h>
36 #include <sys/systm.h>
37 #include <sys/device.h>
38 #include <sys/kernel.h>
39 
40 #include <dev/wscons/wsconsio.h>
41 #include <dev/wscons/wskbdvar.h>
42 #include <dev/wscons/wsksymdef.h>
43 #include <dev/wscons/wsksymvar.h>
44 
45 #include <dev/sun/sunkbdreg.h>
46 #include <dev/sun/sunkbdvar.h>
47 
48 #define	KC(n)	KS_KEYCODE(n)
49 
50 /* 000/021/022 US English type 4/5 keyboard */
51 const keysym_t sunkbd_keydesc_us[] = {
52     KC(0x01), KS_Cmd,
53     KC(0x02), KS_Cmd_BrightnessDown,
54     KC(0x03),				KS_Again,
55     KC(0x04), KS_Cmd_BrightnessUp,
56     KC(0x05),				KS_f1,
57     KC(0x06),				KS_f2,
58     KC(0x07),				KS_f10,
59     KC(0x08),				KS_f3,
60     KC(0x09),				KS_f11,
61     KC(0x0a),				KS_f4,
62     KC(0x0b),				KS_f12,
63     KC(0x0c),				KS_f5,
64     KC(0x0d),				KS_Alt_R,
65     KC(0x0e),				KS_f6,
66     KC(0x10),				KS_f7,
67     KC(0x11),				KS_f8,
68     KC(0x12),				KS_f9,
69     KC(0x13),				KS_Alt_L,
70     KC(0x14),				KS_Up,
71     KC(0x15),				KS_Pause,
72     KC(0x16),				KS_Print_Screen,
73     KC(0x17),				KS_Hold_Screen,
74     KC(0x18),				KS_Left,
75     KC(0x19),				KS_Props,
76     KC(0x1a),				KS_Undo,
77     KC(0x1b),				KS_Down,
78     KC(0x1c),				KS_Right,
79     KC(0x1d),				KS_Escape,
80     KC(0x1e),				KS_1,		KS_exclam,
81     KC(0x1f),				KS_2,		KS_at,
82     KC(0x20),				KS_3,		KS_numbersign,
83     KC(0x21),				KS_4,		KS_dollar,
84     KC(0x22),				KS_5,		KS_percent,
85     KC(0x23),				KS_6,		KS_asciicircum,
86     KC(0x24),				KS_7,		KS_ampersand,
87     KC(0x25),				KS_8,		KS_asterisk,
88     KC(0x26),				KS_9,		KS_parenleft,
89     KC(0x27),				KS_0,		KS_parenright,
90     KC(0x28),				KS_minus,	KS_underscore,
91     KC(0x29),				KS_equal,	KS_plus,
92     KC(0x2a),				KS_grave,	KS_asciitilde,
93     KC(0x2b),				KS_Delete,
94     KC(0x2c),				KS_Insert,
95     KC(0x2d),				KS_KP_Equal,
96     KC(0x2e),				KS_KP_Divide,
97     KC(0x2f),				KS_KP_Multiply,
98     KC(0x31),				KS_Front,
99     KC(0x32),				KS_KP_Delete,	KS_KP_Decimal,
100     KC(0x33),				KS_Copy,
101     KC(0x34),				KS_Home,
102     KC(0x35),				KS_Tab,
103     KC(0x36),				KS_q,
104     KC(0x37),				KS_w,
105     KC(0x38),				KS_e,
106     KC(0x39),				KS_r,
107     KC(0x3a),				KS_t,
108     KC(0x3b),				KS_y,
109     KC(0x3c),				KS_u,
110     KC(0x3d),				KS_i,
111     KC(0x3e),				KS_o,
112     KC(0x3f),				KS_p,
113     KC(0x40),				KS_bracketleft,	KS_braceleft,
114     KC(0x41),				KS_bracketright,KS_braceright,
115     KC(0x42),				KS_Delete,
116     KC(0x43),				KS_Multi_key,
117     KC(0x44),				KS_KP_Home,	KS_KP_7,
118     KC(0x45),				KS_KP_Up,	KS_KP_8,
119     KC(0x46),				KS_KP_Prior,	KS_KP_9,
120     KC(0x47),				KS_KP_Subtract,
121     KC(0x48),				KS_Open,
122     KC(0x49),				KS_Paste,
123     KC(0x4a),				KS_End,
124     KC(0x4c),				KS_Control_L,
125     KC(0x4d), KS_Cmd_Debugger,		KS_a,
126     KC(0x4e),				KS_s,
127     KC(0x4f),				KS_d,
128     KC(0x50),				KS_f,
129     KC(0x51),				KS_g,
130     KC(0x52),				KS_h,
131     KC(0x53),				KS_j,
132     KC(0x54),				KS_k,
133     KC(0x55),				KS_l,
134     KC(0x56),				KS_semicolon,	KS_colon,
135     KC(0x57),				KS_apostrophe,	KS_quotedbl,
136     KC(0x58),				KS_backslash,	KS_bar,
137     KC(0x59),				KS_Return,
138     KC(0x5a),				KS_KP_Enter,
139     KC(0x5b),				KS_KP_Left,	KS_KP_4,
140     KC(0x5c),				KS_KP_Begin,	KS_KP_5,
141     KC(0x5d),				KS_KP_Right,	KS_KP_6,
142     KC(0x5e),				KS_KP_Insert,	KS_KP_0,
143     KC(0x5f),				KS_Find,
144     KC(0x60),				KS_Prior,
145     KC(0x61),				KS_Cut,
146     KC(0x62),				KS_Num_Lock,
147     KC(0x63),				KS_Shift_L,
148     KC(0x64),				KS_z,
149     KC(0x65),				KS_x,
150     KC(0x66),				KS_c,
151     KC(0x67),				KS_v,
152     KC(0x68),				KS_b,
153     KC(0x69),				KS_n,
154     KC(0x6a),				KS_m,
155     KC(0x6b),				KS_comma,	KS_less,
156     KC(0x6c),				KS_period,	KS_greater,
157     KC(0x6d),				KS_slash,	KS_question,
158     KC(0x6e),				KS_Shift_R,
159     KC(0x6f),				KS_Linefeed,
160     KC(0x70),				KS_KP_End,	KS_KP_1,
161     KC(0x71),				KS_KP_Down,	KS_KP_2,
162     KC(0x72),				KS_KP_Next,	KS_KP_3,
163     KC(0x76),				KS_Help,
164     KC(0x77),				KS_Caps_Lock,
165     KC(0x78),				KS_Meta_L,
166     KC(0x79),				KS_space,
167     KC(0x7a),				KS_Meta_R,
168     KC(0x7b),				KS_Next,
169     KC(0x7d),				KS_KP_Add,
170 };
171 
172 /* 002 French/Belgian type 4 keyboard */
173 const keysym_t sunkbd_keydesc_befr[] = {
174     KC(0x0d),		KS_Caps_Lock,
175     KC(0x0f),		KS_bracketright,KS_braceright,	KS_guillemotright,
176     KC(0x1e),		KS_ampersand,	KS_1,
177     KC(0x1f),		KS_eacute,	KS_2,		KS_twosuperior,
178     KC(0x20),		KS_quotedbl,	KS_3,		KS_threesuperior,
179     KC(0x21),		KS_apostrophe,	KS_4,
180     KC(0x22),		KS_parenleft,	KS_5,
181     KC(0x23),		KS_paragraph,	KS_6,
182     KC(0x24),		KS_egrave,	KS_7,
183     KC(0x25),		KS_exclam,	KS_8,		KS_sterling,
184     KC(0x26),		KS_ccedilla,	KS_9,		KS_backslash,
185     KC(0x27),		KS_agrave,	KS_0,
186     KC(0x28),		KS_parenright,	KS_degree,	KS_asciitilde,
187     KC(0x29),		KS_minus,	KS_underscore,	KS_numbersign,
188     KC(0x2a),		KS_asterisk,	KS_bar,		KS_currency,
189     KC(0x36),		KS_a,
190     KC(0x37),		KS_z,
191     KC(0x40),		KS_dead_circumflex,KS_dead_diaeresis,
192     KC(0x41),		KS_grave,	KS_dollar,	KS_at,
193     KC(0x4d), KS_Cmd_Debugger,	KS_q,
194     KC(0x56),		KS_m,		KS_M,		KS_mu,
195     KC(0x57),		KS_ugrave,	KS_percent,
196     KC(0x58),		KS_bracketleft,	KS_braceleft,	KS_guillemotleft,
197     KC(0x64),		KS_w,
198     KC(0x6a),		KS_comma,	KS_question,
199     KC(0x6b),		KS_semicolon,	KS_period,
200     KC(0x6c),		KS_colon,	KS_slash,
201     KC(0x6d),		KS_equal,	KS_plus,
202     KC(0x77),		KS_Mode_switch,
203     KC(0x7c),		KS_less,	KS_greater,
204 };
205 
206 /* 023 French type 5 keyboard */
207 const keysym_t sunkbd5_keydesc_fr[] = {
208     KC(0x0d),		KS_Mode_switch,
209     KC(0x1e),		KS_ampersand,	KS_1,
210     KC(0x1f),		KS_eacute,	KS_2,		KS_asciitilde,
211     KC(0x20),		KS_quotedbl,	KS_3,		KS_numbersign,
212     KC(0x21),		KS_apostrophe,	KS_4,		KS_braceleft,
213     KC(0x22),		KS_parenleft,	KS_5,		KS_bracketleft,
214     KC(0x23),		KS_minus,	KS_6,		KS_bar,
215     KC(0x24),		KS_egrave,	KS_7,		KS_grave,
216     KC(0x25),		KS_underscore,	KS_8,		KS_backslash,
217     KC(0x26),		KS_ccedilla,	KS_9,		KS_asciicircum,
218     KC(0x27),		KS_agrave,	KS_0,		KS_at,
219     KC(0x28),		KS_parenright,	KS_degree,	KS_bracketright,
220     KC(0x29),		KS_equal,	KS_plus,	KS_braceright,
221     KC(0x2a),		KS_twosuperior,
222     KC(0x36),		KS_a,
223     KC(0x37),		KS_z,
224     KC(0x40),		KS_dead_circumflex,KS_dead_diaeresis,
225     KC(0x41),		KS_dollar,	KS_sterling,	KS_currency,
226     KC(0x4d), KS_Cmd_Debugger,	KS_q,
227     KC(0x56),		KS_m,
228     KC(0x57),		KS_ugrave,	KS_percent,
229     KC(0x58),		KS_asterisk,	KS_mu,
230     KC(0x64),		KS_w,
231     KC(0x6a),		KS_comma,	KS_question,
232     KC(0x6b),		KS_semicolon,	KS_period,
233     KC(0x6c),		KS_colon,	KS_slash,
234     KC(0x6d),		KS_exclam,	KS_paragraph,
235     KC(0x7c),		KS_less,	KS_greater,
236 };
237 
238 /* 004 Danish type 4 keyboard */
239 const keysym_t sunkbd_keydesc_dk[] = {
240     KC(0x0d),		KS_Multi_key,
241     KC(0x0f),		KS_asciitilde,	KS_asciicircum,
242     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
243     KC(0x20),		KS_3,		KS_numbersign,	KS_sterling,
244     KC(0x21),		KS_4,		KS_currency,	KS_dollar,
245     KC(0x23),		KS_6,		KS_ampersand,
246     KC(0x24),		KS_7,		KS_slash,	KS_braceleft,
247     KC(0x25),		KS_8,		KS_parenleft,	KS_bracketleft,
248     KC(0x26),		KS_9,		KS_parenright,	KS_bracketright,
249     KC(0x27),		KS_0,		KS_equal,	KS_braceright,
250     KC(0x28),		KS_plus,	KS_question,
251     KC(0x29),		KS_dead_acute,	KS_dead_grave,	KS_bar,
252     KC(0x2a),		KS_apostrophe,	KS_asterisk,	KS_grave,
253     KC(0x40),		KS_aring,
254     KC(0x41),		KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
255     KC(0x43),		KS_Mode_switch,
256     KC(0x4c),		KS_Caps_Lock,
257     KC(0x56),		KS_ae,
258     KC(0x57),		KS_oslash,
259     KC(0x58),		KS_onehalf,	KS_paragraph,
260     KC(0x6b),		KS_comma,	KS_semicolon,
261     KC(0x6c),		KS_period,	KS_colon,
262     KC(0x6d),		KS_minus,	KS_underscore,
263     KC(0x77),		KS_Control_L,
264     KC(0x7c),		KS_less,	KS_greater,	KS_backslash,
265 };
266 
267 /* 024 Danish type 5 keyboard */
268 const keysym_t sunkbd5_keydesc_dk[] = {
269     KC(0x0d),		KS_Mode_switch,
270     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
271     KC(0x20),		KS_3,		KS_numbersign,	KS_sterling,
272     KC(0x21),		KS_4,		KS_currency,	KS_dollar,
273     KC(0x22),		KS_5,		KS_percent,	KS_asciitilde,
274     KC(0x23),		KS_6,		KS_ampersand,	KS_asciicircum,
275     KC(0x24),		KS_7,		KS_slash,	KS_braceleft,
276     KC(0x25),		KS_8,		KS_parenleft,	KS_bracketleft,
277     KC(0x26),		KS_9,		KS_parenright,	KS_bracketright,
278     KC(0x27),		KS_0,		KS_equal,	KS_braceright,
279     KC(0x28),		KS_plus,	KS_question,
280     KC(0x29),		KS_dead_acute,	KS_dead_grave,	KS_bar,
281     KC(0x2a),		KS_onehalf,	KS_asterisk,	KS_grave,
282     KC(0x40),		KS_aring,
283     KC(0x41),		KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
284     KC(0x56),		KS_ae,
285     KC(0x57),		KS_oslash,
286     KC(0x58),		KS_backslash,	KS_asterisk,	KS_grave,
287     KC(0x6b),		KS_comma,	KS_semicolon,
288     KC(0x6c),		KS_period,	KS_colon,
289     KC(0x6d),		KS_minus,	KS_underscore,
290     KC(0x7c),		KS_less,	KS_greater,	KS_backslash,
291 };
292 
293 /* 005 German type 4 keyboard */
294 const keysym_t sunkbd_keydesc_de[] = {
295     KC(0x0d),		KS_Alt_L,
296     KC(0x0f),		KS_bracketright,KS_braceright,	KS_guillemotright,
297     KC(0x13),		KS_Mode_switch,
298     KC(0x1f),		KS_2,		KS_quotedbl,	KS_twosuperior,
299     KC(0x20),		KS_3,		KS_paragraph,	KS_threesuperior,
300     KC(0x23),		KS_6,		KS_ampersand,
301     KC(0x24),		KS_7,		KS_slash,	KS_degree,
302     KC(0x25),		KS_8,		KS_parenleft,	KS_grave,
303     KC(0x26),		KS_9,		KS_parenright,	KS_apostrophe,
304     KC(0x27),		KS_0,		KS_equal,	KS_bar,
305     KC(0x28),		KS_ssharp,	KS_question,	KS_backslash,
306     KC(0x29),		KS_dead_acute,	KS_dead_grave,
307     KC(0x2a),		KS_numbersign,	KS_asciicircum,	KS_at,
308     KC(0x3b),		KS_z,
309     KC(0x40),		KS_udiaeresis,
310     KC(0x41),		KS_plus,	KS_multiply,	KS_asciitilde,
311     KC(0x4c),		KS_Caps_Lock,
312     KC(0x56),		KS_odiaeresis,
313     KC(0x57),		KS_adiaeresis,
314     KC(0x58),		KS_bracketleft,	KS_braceleft,	KS_guillemotleft,
315     KC(0x64),		KS_y,
316     KC(0x6a),		KS_m,		KS_M,		KS_mu,
317     KC(0x6b),		KS_comma,	KS_semicolon,
318     KC(0x6c),		KS_period,	KS_colon,
319     KC(0x6d),		KS_minus,	KS_underscore,
320     KC(0x77),		KS_Control_L,
321     KC(0x7c),		KS_less,	KS_greater,
322 };
323 
324 /* 025 German type 5 keyboard */
325 const keysym_t sunkbd5_keydesc_de[] = {
326     KC(0x0d),		KS_Mode_switch,
327     KC(0x1f),		KS_2,		KS_quotedbl,	KS_twosuperior,
328     KC(0x20),		KS_3,		KS_paragraph,	KS_threesuperior,
329     KC(0x23),		KS_6,		KS_ampersand,
330     KC(0x24),		KS_7,		KS_slash,	KS_braceleft,
331     KC(0x25),		KS_8,		KS_parenleft,	KS_bracketleft,
332     KC(0x26),		KS_9,		KS_parenright,	KS_bracketright,
333     KC(0x27),		KS_0,		KS_equal,	KS_braceright,
334     KC(0x28),		KS_ssharp,	KS_question,	KS_backslash,
335     KC(0x29),		KS_dead_acute,	KS_dead_grave,
336     KC(0x2a),		KS_asciicircum,	KS_degree,
337     KC(0x36),		KS_q,		KS_Q,		KS_at,
338     KC(0x3b),		KS_z,
339     KC(0x40),		KS_udiaeresis,
340     KC(0x41),		KS_plus,	KS_multiply,	KS_asciitilde,
341     KC(0x56),		KS_odiaeresis,
342     KC(0x57),		KS_adiaeresis,
343     KC(0x58),		KS_numbersign,	KS_apostrophe,	KS_grave,
344     KC(0x64),		KS_y,
345     KC(0x6a),		KS_m,		KS_M,		KS_mu,
346     KC(0x6b),		KS_comma,	KS_semicolon,
347     KC(0x6c),		KS_period,	KS_colon,
348     KC(0x6d),		KS_minus,	KS_underscore,
349     KC(0x7c),		KS_less,	KS_greater,	KS_bar,
350 };
351 
352 /* 006 Italian type 4 keyboard */
353 const keysym_t sunkbd_keydesc_it[] = {
354     KC(0x0d),		KS_Mode_switch,
355     KC(0x0f),		KS_bracketright,KS_braceright,	KS_guillemotright,
356     KC(0x1f),		KS_2,		KS_quotedbl,	KS_twosuperior,
357     KC(0x20),		KS_3,		KS_sterling,	KS_threesuperior,
358     KC(0x23),		KS_6,		KS_ampersand,	KS_notsign,
359     KC(0x24),		KS_7,		KS_slash,
360     KC(0x25),		KS_8,		KS_parenleft,
361     KC(0x26),		KS_9,		KS_parenright,	KS_backslash,
362     KC(0x27),		KS_0,		KS_equal,	KS_bar,
363     KC(0x28),		KS_apostrophe,	KS_question,	KS_grave,
364     KC(0x29),		KS_igrave,	KS_asciicircum,
365     KC(0x2a),		KS_ugrave,	KS_paragraph,
366     KC(0x40),		KS_egrave,	KS_eacute,
367     KC(0x41),		KS_plus,	KS_asterisk,	KS_asciitilde,
368     KC(0x4c),		KS_Caps_Lock,
369     KC(0x56),		KS_ograve,	KS_ccedilla,	KS_at,
370     KC(0x57),		KS_agrave,	KS_degree,	KS_numbersign,
371     KC(0x58),		KS_bracketleft,	KS_braceleft,	KS_guillemotleft,
372     KC(0x6b),		KS_comma,	KS_semicolon,
373     KC(0x6c),		KS_period,	KS_colon,
374     KC(0x6d),		KS_minus,	KS_underscore,
375     KC(0x77),		KS_Control_L,
376     KC(0x7c),		KS_less,	KS_greater,
377 };
378 
379 /* 026 Italian type 5 keyboard */
380 const keysym_t sunkbd5_keydesc_it[] = {
381     KC(0x0d),		KS_Mode_switch,
382     KC(0x1f),		KS_2,		KS_quotedbl,
383     KC(0x20),		KS_3,		KS_sterling,
384     KC(0x23),		KS_6,		KS_ampersand,
385     KC(0x24),		KS_7,		KS_slash,
386     KC(0x25),		KS_8,		KS_parenleft,	KS_braceleft,
387     KC(0x26),		KS_9,		KS_parenright,	KS_braceright,
388     KC(0x27),		KS_0,		KS_equal,
389     KC(0x28),		KS_apostrophe,	KS_question,	KS_grave,
390     KC(0x29),		KS_igrave,	KS_asciicircum,
391     KC(0x2a),		KS_backslash,	KS_bar,
392     KC(0x40),		KS_egrave,	KS_eacute,	KS_bracketleft,
393     KC(0x41),		KS_plus,	KS_asterisk,	KS_bracketright,
394     KC(0x56),		KS_ograve,	KS_ccedilla,	KS_at,
395     KC(0x57),		KS_agrave,	KS_degree,	KS_numbersign,
396     KC(0x58),		KS_ugrave,	KS_paragraph,	KS_asciitilde,
397     KC(0x6b),		KS_comma,	KS_semicolon,
398     KC(0x6c),		KS_period,	KS_colon,
399     KC(0x6d),		KS_minus,	KS_underscore,
400     KC(0x7c),		KS_less,	KS_greater,
401 };
402 
403 /* 007 Dutch type 4 keyboard */
404 const keysym_t sunkbd_keydesc_nl[] = {
405     KC(0x0d),		KS_Caps_Lock,
406     KC(0x0f),		KS_backslash,	KS_bar,
407     KC(0x1e),		KS_1,		KS_exclam,	KS_onesuperior,
408     KC(0x1f),		KS_2,		KS_quotedbl,	KS_twosuperior,
409     KC(0x20),		KS_3,		KS_numbersign,	KS_threesuperior,
410     KC(0x21),		KS_4,		KS_dollar,	KS_onequarter,
411     KC(0x22),		KS_5,		KS_percent,	KS_onehalf,
412     KC(0x23),		KS_6,		KS_ampersand,	KS_threequarters,
413     KC(0x24),		KS_7,		KS_underscore,	KS_sterling,
414     KC(0x25),		KS_8,		KS_parenleft,	KS_braceleft,
415     KC(0x26),		KS_9,		KS_parenright,	KS_braceright,
416     KC(0x27),		KS_0,		KS_apostrophe,	KS_grave,
417     KC(0x28),		KS_slash,	KS_question,
418     KC(0x29),		KS_degree,	KS_dead_tilde,	KS_dead_abovering,
419     KC(0x2a),		KS_less,	KS_greater,
420     KC(0x40),		KS_dead_diaeresis,KS_dead_circumflex,
421     KC(0x41),		KS_asterisk,	KS_brokenbar,	KS_asciitilde,
422     KC(0x4e),		KS_s,		KS_S,		KS_ssharp,
423     KC(0x56),		KS_plus,	KS_plusminus,
424     KC(0x57),		KS_dead_acute,	KS_dead_grave,
425     KC(0x58),		KS_at,		KS_paragraph,	KS_notsign,
426     KC(0x64),		KS_z,		KS_Z,		KS_guillemotleft,
427     KC(0x65),		KS_x,		KS_X,		KS_guillemotright,
428     KC(0x66),		KS_c,		KS_C,		KS_cent,
429     KC(0x6a),		KS_m,		KS_M,		KS_mu,
430     KC(0x6b),		KS_comma,	KS_semicolon,
431     KC(0x6c),		KS_period,	KS_colon,
432     KC(0x6d),		KS_minus,	KS_equal,
433     KC(0x77),		KS_Mode_switch,
434     KC(0x7d),		KS_bracketright,KS_bracketleft,
435 };
436 
437 /* 027 Dutch type 5 keyboard */
438 const keysym_t sunkbd5_keydesc_nl[] = {
439     KC(0x0d),		KS_Mode_switch,
440     KC(0x1e),		KS_1,		KS_exclam,	KS_onesuperior,
441     KC(0x1f),		KS_2,		KS_quotedbl,	KS_twosuperior,
442     KC(0x20),		KS_3,		KS_numbersign,	KS_threesuperior,
443     KC(0x21),		KS_4,		KS_dollar,	KS_onequarter,
444     KC(0x22),		KS_5,		KS_percent,	KS_onehalf,
445     KC(0x23),		KS_6,		KS_ampersand,	KS_threequarters,
446     KC(0x24),		KS_7,		KS_underscore,	KS_sterling,
447     KC(0x25),		KS_8,		KS_parenleft,	KS_braceleft,
448     KC(0x26),		KS_9,		KS_parenright,	KS_braceright,
449     KC(0x27),		KS_0,		KS_apostrophe,	KS_grave,
450     KC(0x28),		KS_slash,	KS_question,	KS_backslash,
451     KC(0x29),		KS_degree,	KS_dead_tilde,	KS_dead_abovering,
452     KC(0x2a),		KS_at,		KS_paragraph,	KS_notsign,
453     KC(0x40),		KS_dead_diaeresis,KS_dead_circumflex,
454     KC(0x41),		KS_asterisk,	KS_bar,		KS_asciitilde,
455     KC(0x4e),		KS_s,		KS_S,		KS_ssharp,
456     KC(0x56),		KS_plus,	KS_plusminus,
457     KC(0x57),		KS_dead_acute,	KS_dead_grave,
458     KC(0x58),		KS_less,	KS_greater,	KS_asciicircum,
459     KC(0x64),		KS_z,		KS_Z,		KS_guillemotleft,
460     KC(0x65),		KS_x,		KS_X,		KS_guillemotright,
461     KC(0x66),		KS_c,		KS_C,		KS_cent,
462     KC(0x6a),		KS_m,		KS_M,		KS_mu,
463     KC(0x6b),		KS_comma,	KS_semicolon,
464     KC(0x6c),		KS_period,	KS_colon,	KS_hyphen,
465     KC(0x6d),		KS_minus,	KS_equal,
466     KC(0x7d),		KS_bracketright,KS_bracketleft,	KS_brokenbar,
467 };
468 
469 /* 008 Norwegian type 4 keyboard */
470 const keysym_t sunkbd_keydesc_no[] = {
471     KC(0x0d),		KS_Mode_switch,
472     KC(0x0f),		KS_asciitilde,	KS_asciicircum,
473     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
474     KC(0x20),		KS_3,		KS_numbersign,	KS_sterling,
475     KC(0x21),		KS_4,		KS_currency,	KS_dollar,
476     KC(0x23),		KS_6,		KS_ampersand,
477     KC(0x24),		KS_7,		KS_slash,	KS_braceleft,
478     KC(0x25),		KS_8,		KS_parenleft,	KS_bracketleft,
479     KC(0x26),		KS_9,		KS_parenright,	KS_bracketright,
480     KC(0x27),		KS_0,		KS_equal,	KS_braceright,
481     KC(0x28),		KS_plus,	KS_question,
482     KC(0x29),		KS_backslash,	KS_dead_grave,	KS_dead_acute,
483     KC(0x2a),		KS_apostrophe,	KS_asterisk,	KS_grave,
484     KC(0x40),		KS_aring,
485     KC(0x41),		KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
486     KC(0x4c),		KS_Caps_Lock,
487     KC(0x56),		KS_oslash,
488     KC(0x57),		KS_ae,
489     KC(0x58),		KS_bar,		KS_paragraph,
490     KC(0x6b),		KS_comma,	KS_semicolon,
491     KC(0x6c),		KS_period,	KS_colon,
492     KC(0x6d),		KS_minus,	KS_underscore,
493     KC(0x77),		KS_Control_L,
494     KC(0x7d),		KS_less,	KS_greater,
495 };
496 
497 /* 028 Norwegian type 5 keyboard */
498 const keysym_t sunkbd5_keydesc_no[] = {
499     KC(0x0d),		KS_Mode_switch,
500     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
501     KC(0x20),		KS_3,		KS_numbersign,	KS_sterling,
502     KC(0x21),		KS_4,		KS_currency,	KS_dollar,
503     KC(0x22),		KS_5,		KS_percent,	KS_asciitilde,
504     KC(0x23),		KS_6,		KS_ampersand,	KS_asciicircum,
505     KC(0x24),		KS_7,		KS_slash,	KS_braceleft,
506     KC(0x25),		KS_8,		KS_parenleft,	KS_bracketleft,
507     KC(0x26),		KS_9,		KS_parenright,	KS_bracketright,
508     KC(0x27),		KS_0,		KS_equal,	KS_braceright,
509     KC(0x28),		KS_plus,	KS_question,
510     KC(0x29),		KS_backslash,	KS_dead_grave,	KS_dead_acute,
511     KC(0x2a),		KS_bar,		KS_paragraph,
512     KC(0x40),		KS_aring,
513     KC(0x41),		KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
514     KC(0x56),		KS_oslash,
515     KC(0x57),		KS_ae,
516     KC(0x58),		KS_apostrophe,	KS_asterisk,	KS_grave,
517     KC(0x6b),		KS_comma,	KS_semicolon,
518     KC(0x6c),		KS_period,	KS_colon,
519     KC(0x6d),		KS_minus,	KS_underscore,
520     KC(0x7d),		KS_less,	KS_greater,
521 };
522 
523 /* 009 Portuguese type 4 keyboard */
524 const keysym_t sunkbd_keydesc_pt[] = {
525     KC(0x0d),		KS_Mode_switch,
526     KC(0x0f),		KS_bracketright,KS_braceright,	KS_guillemotright,
527     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
528     KC(0x20),		KS_3,		KS_numbersign,	KS_sterling,
529     KC(0x21),		KS_4,		KS_dollar,	KS_paragraph,
530     KC(0x23),		KS_6,		KS_ampersand,	KS_notsign,
531     KC(0x24),		KS_7,		KS_slash,
532     KC(0x25),		KS_8,		KS_parenleft,
533     KC(0x26),		KS_9,		KS_parenright,	KS_backslash,
534     KC(0x27),		KS_0,		KS_equal,	KS_bar,
535     KC(0x28),		KS_apostrophe,	KS_question,	KS_grave,
536     KC(0x29),		KS_exclamdown,	KS_questiondown,
537     KC(0x2a),		KS_dead_tilde,	KS_dead_circumflex,KS_asciicircum,
538     KC(0x40),		KS_dead_diaeresis,KS_asterisk,	KS_plus,
539     KC(0x41),		KS_dead_acute,	KS_dead_grave,	KS_asciitilde,
540     KC(0x4c),		KS_Caps_Lock,
541     KC(0x56),		KS_ccedilla,
542     KC(0x57),		KS_masculine,	KS_ordfeminine,
543     KC(0x58),		KS_bracketleft,	KS_braceleft,	KS_guillemotleft,
544     KC(0x6b),		KS_comma,	KS_semicolon,
545     KC(0x6c),		KS_period,	KS_colon,
546     KC(0x6d),		KS_minus,	KS_underscore,
547     KC(0x77),		KS_Control_L,
548     KC(0x7d),		KS_less,	KS_greater,
549 };
550 
551 /* 029 Portuguese type 4 keyboard */
552 const keysym_t sunkbd5_keydesc_pt[] = {
553     KC(0x0d),		KS_Mode_switch,
554     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
555     KC(0x20),		KS_3,		KS_numbersign,	KS_sterling,
556     KC(0x21),		KS_4,		KS_dollar,	KS_paragraph,
557     KC(0x22),		KS_5,		KS_percent,	KS_asciitilde,
558     KC(0x23),		KS_6,		KS_ampersand,	KS_asciicircum,
559     KC(0x24),		KS_7,		KS_slash,	KS_braceleft,
560     KC(0x25),		KS_8,		KS_parenleft,	KS_bracketleft,
561     KC(0x26),		KS_9,		KS_parenright,	KS_bracketright,
562     KC(0x27),		KS_0,		KS_equal,	KS_braceright,
563     KC(0x28),		KS_apostrophe,	KS_question,	KS_grave,
564     KC(0x29),		KS_guillemotleft,KS_guillemotright,
565     KC(0x2a),		KS_backslash,	KS_bar,
566     KC(0x40),		KS_plus,	KS_asterisk,	KS_dead_diaeresis,
567     KC(0x41),		KS_dead_acute,	KS_dead_grave,
568     KC(0x56),		KS_ccedilla,
569     KC(0x57),		KS_masculine,	KS_ordfeminine,
570     KC(0x58),		KS_dead_tilde,	KS_dead_circumflex,
571     KC(0x6b),		KS_comma,	KS_semicolon,
572     KC(0x6c),		KS_period,	KS_colon,
573     KC(0x6d),		KS_minus,	KS_underscore,
574     KC(0x7d),		KS_less,	KS_greater,
575 };
576 
577 /* 00a Spanish type 4 keyboard */
578 const keysym_t sunkbd_keydesc_es[] = {
579     KC(0x0d),		KS_Mode_switch,
580     KC(0x0f),		KS_bracketright,KS_braceright,	KS_guillemotright,
581     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
582     KC(0x20),		KS_3,		KS_hyphen,	KS_numbersign,
583     KC(0x22),		KS_5,		KS_percent,	KS_degree,
584     KC(0x23),		KS_6,		KS_ampersand,	KS_notsign,
585     KC(0x24),		KS_7,		KS_slash,
586     KC(0x25),		KS_8,		KS_parenleft,
587     KC(0x26),		KS_9,		KS_parenright,	KS_backslash,
588     KC(0x27),		KS_0,		KS_equal,	KS_bar,
589     KC(0x28),		KS_apostrophe,	KS_question,	KS_grave,
590     KC(0x29),		KS_exclamdown,	KS_questiondown,
591     KC(0x2a),		KS_ccedilla,
592     KC(0x3e),		KS_o,		KS_O,		KS_masculine,
593     KC(0x40),		KS_dead_grave,	KS_dead_circumflex,KS_asciicircum,
594     KC(0x41),		KS_plus,	KS_asterisk,	KS_asciitilde,
595     KC(0x4c),		KS_Caps_Lock,
596     KC(0x4d),		KS_a,		KS_A,		KS_ordfeminine,
597     KC(0x56),		KS_ntilde,
598     KC(0x57),		KS_dead_acute,	KS_dead_diaeresis,
599     KC(0x58),		KS_bracketleft,	KS_braceleft,	KS_guillemotleft,
600     KC(0x6b),		KS_comma,	KS_semicolon,
601     KC(0x6c),		KS_period,	KS_colon,
602     KC(0x6d),		KS_minus,	KS_underscore,
603     KC(0x77),		KS_Control_L,
604     KC(0x7d),		KS_less,	KS_greater,
605 };
606 
607 /* 02a Spanish type 5 keyboard */
608 const keysym_t sunkbd5_keydesc_es[] = {
609     KC(0x0d),		KS_Mode_switch,
610     KC(0x1e),		KS_1,		KS_exclam,	KS_bar,
611     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
612     KC(0x20),		KS_3,		KS_hyphen,	KS_numbersign,
613     KC(0x21),		KS_4,		KS_dollar,	KS_asciicircum,
614     KC(0x22),		KS_5,		KS_percent,	KS_asciitilde,
615     KC(0x23),		KS_6,		KS_ampersand,	KS_notsign,
616     KC(0x24),		KS_7,		KS_slash,
617     KC(0x25),		KS_8,		KS_parenleft,
618     KC(0x26),		KS_9,		KS_parenright,
619     KC(0x27),		KS_0,		KS_equal,
620     KC(0x28),		KS_apostrophe,	KS_question,	KS_grave,
621     KC(0x29),		KS_exclamdown,	KS_questiondown,
622     KC(0x2a),		KS_masculine,	KS_ordfeminine,	KS_backslash,
623     KC(0x40),		KS_dead_grave,	KS_dead_circumflex,KS_bracketleft,
624     KC(0x41),		KS_plus,	KS_asterisk,	KS_bracketright,
625     KC(0x56),		KS_ntilde,
626     KC(0x57),		KS_dead_acute,	KS_dead_diaeresis,KS_braceleft,
627     KC(0x58),		KS_ccedilla,	KS_Ccedilla,	KS_braceright,
628     KC(0x6b),		KS_comma,	KS_semicolon,
629     KC(0x6c),		KS_period,	KS_colon,
630     KC(0x6d),		KS_minus,	KS_underscore,
631     KC(0x7d),		KS_less,	KS_greater,
632 };
633 
634 /* 00b Swedish/Finnish type 4 keyboard */
635 const keysym_t sunkbd_keydesc_sv[] = {
636     KC(0x0d),		KS_Multi_key,
637     KC(0x0f),		KS_asciitilde,	KS_asciicircum,
638     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
639     KC(0x20),		KS_3,		KS_numbersign,	KS_sterling,
640     KC(0x21),		KS_4,		KS_currency,	KS_dollar,
641     KC(0x23),		KS_6,		KS_ampersand,
642     KC(0x24),		KS_7,		KS_slash,	KS_braceleft,
643     KC(0x25),		KS_8,		KS_parenleft,	KS_bracketleft,
644     KC(0x26),		KS_9,		KS_parenright,	KS_bracketright,
645     KC(0x27),		KS_0,		KS_equal,	KS_braceright,
646     KC(0x28),		KS_plus,	KS_question,	KS_backslash,
647     KC(0x29),		KS_dead_acute,	KS_dead_grave,
648     KC(0x2a),		KS_apostrophe,	KS_asterisk,	KS_grave,
649     KC(0x40),		KS_aring,
650     KC(0x41),		KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
651     KC(0x43),		KS_Mode_switch,
652     KC(0x4c),		KS_Caps_Lock,
653     KC(0x56),		KS_odiaeresis,
654     KC(0x57),		KS_adiaeresis,
655     KC(0x58),		KS_paragraph,	KS_onehalf,
656     KC(0x6b),		KS_comma,	KS_semicolon,
657     KC(0x6c),		KS_period,	KS_colon,
658     KC(0x6d),		KS_minus,	KS_underscore,
659     KC(0x77),		KS_Control_L,
660     KC(0x7c),		KS_less,	KS_greater,	KS_bar,
661 };
662 
663 const keysym_t sunkbd_keydesc_sv_nodead[] = {
664     KC(0x29),		KS_apostrophe,	KS_grave,
665     KC(0x41),		KS_diaeresis,	KS_asciicircum,	KS_asciitilde,
666 };
667 
668 /* 02b Swedish type 5 keyboard */
669 const keysym_t sunkbd5_keydesc_sv[] = {
670     KC(0x0d),		KS_Mode_switch,
671     KC(0x0f),		KS_asciitilde,	KS_asciicircum,
672     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
673     KC(0x20),		KS_3,		KS_numbersign,	KS_sterling,
674     KC(0x21),		KS_4,		KS_currency,	KS_dollar,
675     KC(0x23),		KS_6,		KS_ampersand,
676     KC(0x24),		KS_7,		KS_slash,	KS_braceleft,
677     KC(0x25),		KS_8,		KS_parenleft,	KS_bracketleft,
678     KC(0x26),		KS_9,		KS_parenright,	KS_bracketright,
679     KC(0x27),		KS_0,		KS_equal,	KS_braceright,
680     KC(0x28),		KS_plus,	KS_question,	KS_backslash,
681     KC(0x29),		KS_dead_acute,	KS_dead_grave,
682     KC(0x2a),		KS_paragraph,	KS_onehalf,
683     KC(0x40),		KS_aring,
684     KC(0x41),		KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
685     KC(0x43),		KS_Multi_key,
686     KC(0x4c),		KS_Control_L,
687     KC(0x56),		KS_odiaeresis,
688     KC(0x57),		KS_adiaeresis,
689     KC(0x58),		KS_apostrophe,	KS_asterisk,	KS_grave,
690     KC(0x6b),		KS_comma,	KS_semicolon,
691     KC(0x6c),		KS_period,	KS_colon,
692     KC(0x6d),		KS_minus,	KS_underscore,
693     KC(0x77),		KS_Caps_Lock,
694     KC(0x7c),		KS_less,	KS_greater,	KS_bar,
695 };
696 
697 /* 00c Swiss-French type 4 keyboard */
698 const keysym_t sunkbd_keydesc_sf[] = {
699     KC(0x0d),		KS_Multi_key,
700     KC(0x0f),		KS_greater,	KS_braceright,
701     KC(0x1e),		KS_1,		KS_plus,	KS_exclam,
702     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
703     KC(0x20),		KS_3,		KS_asterisk,	KS_numbersign,
704     KC(0x21),		KS_4,		KS_ccedilla,	KS_cent,
705     KC(0x22),		KS_5,		KS_percent,	KS_asciitilde,
706     KC(0x23),		KS_6,		KS_ampersand,	KS_paragraph,
707     KC(0x24),		KS_7,		KS_slash,	KS_bar,
708     KC(0x25),		KS_8,		KS_parenleft,	KS_degree,
709     KC(0x26),		KS_9,		KS_parenright,	KS_backslash,
710     KC(0x27),		KS_0,		KS_equal,	KS_asciicircum,
711     KC(0x28),		KS_apostrophe,	KS_question,	KS_grave,
712     KC(0x29),		KS_dead_circumflex,KS_dead_grave,
713     KC(0x2a),		KS_dollar,	KS_dead_tilde,	KS_sterling,
714     KC(0x3b),		KS_z,
715     KC(0x40),		KS_egrave,	KS_udiaeresis,
716     KC(0x41),		KS_dead_diaeresis,KS_dead_acute,
717     KC(0x43),		KS_Mode_switch,
718     KC(0x4c),		KS_Caps_Lock,
719     KC(0x56),		KS_eacute,	KS_odiaeresis,
720     KC(0x57),		KS_agrave,	KS_adiaeresis,
721     KC(0x58),		KS_less,	KS_braceleft,
722     KC(0x64),		KS_y,
723     KC(0x6a),		KS_m,		KS_M,		KS_mu,
724     KC(0x6b),		KS_comma,	KS_semicolon,
725     KC(0x6c),		KS_period,	KS_colon,
726     KC(0x6d),		KS_minus,	KS_underscore,
727     KC(0x77),		KS_Control_L,
728     KC(0x7c),		KS_bracketright,KS_bracketleft,	KS_backslash,
729 };
730 
731 /* 02c Swiss-French type 5 keyboard */
732 const keysym_t sunkbd5_keydesc_sf[] = {
733     KC(0x0d),		KS_Mode_switch,
734     KC(0x1e),		KS_1,		KS_plus,	KS_bar,
735     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
736     KC(0x20),		KS_3,		KS_asterisk,	KS_numbersign,
737     KC(0x21),		KS_4,		KS_ccedilla,	KS_asciicircum,
738     KC(0x22),		KS_5,		KS_percent,	KS_asciitilde,
739     KC(0x23),		KS_6,		KS_ampersand,
740     KC(0x24),		KS_7,		KS_slash,
741     KC(0x25),		KS_8,		KS_parenleft,
742     KC(0x26),		KS_9,		KS_parenright,
743     KC(0x27),		KS_0,		KS_equal,	KS_grave,
744     KC(0x28),		KS_apostrophe,	KS_question,	KS_dead_acute,
745     KC(0x29),		KS_dead_circumflex,KS_dead_grave,KS_dead_tilde,
746     KC(0x2a),		KS_dollar,	KS_degree,
747     KC(0x3b),		KS_z,
748     KC(0x40),		KS_egrave,	KS_udiaeresis,	KS_bracketleft,
749     KC(0x41),		KS_dead_diaeresis,KS_exclam,	KS_bracketright,
750     KC(0x56),		KS_eacute,	KS_odiaeresis,
751     KC(0x57),		KS_agrave,	KS_adiaeresis,	KS_braceleft,
752     KC(0x58),		KS_dollar,	KS_sterling,	KS_braceright,
753     KC(0x64),		KS_y,
754     KC(0x6b),		KS_comma,	KS_semicolon,
755     KC(0x6c),		KS_period,	KS_colon,
756     KC(0x6d),		KS_minus,	KS_underscore,
757     KC(0x7c),		KS_less,	KS_greater,	KS_backslash,
758 };
759 
760 /* 00d Swiss-German type 4 keyboard */
761 const keysym_t sunkbd_keydesc_sg[] = {
762     KC(0x0d),		KS_Multi_key,
763     KC(0x0f),		KS_greater,	KS_braceright,
764     KC(0x1e),		KS_1,		KS_plus,	KS_exclam,
765     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
766     KC(0x20),		KS_3,		KS_asterisk,	KS_numbersign,
767     KC(0x21),		KS_4,		KS_ccedilla,	KS_cent,
768     KC(0x22),		KS_5,		KS_percent,	KS_asciitilde,
769     KC(0x23),		KS_6,		KS_ampersand,	KS_paragraph,
770     KC(0x24),		KS_7,		KS_slash,	KS_bar,
771     KC(0x25),		KS_8,		KS_parenleft,	KS_degree,
772     KC(0x26),		KS_9,		KS_parenright,	KS_backslash,
773     KC(0x27),		KS_0,		KS_equal,	KS_asciicircum,
774     KC(0x28),		KS_apostrophe,	KS_question,	KS_grave,
775     KC(0x29),		KS_dead_circumflex,KS_dead_grave,
776     KC(0x2a),		KS_dollar,	KS_dead_tilde,	KS_sterling,
777     KC(0x3b),		KS_z,
778     KC(0x40),		KS_udiaeresis,	KS_egrave,
779     KC(0x41),		KS_dead_diaeresis,KS_dead_acute,
780     KC(0x43),		KS_Mode_switch,
781     KC(0x4c),		KS_Caps_Lock,
782     KC(0x56),		KS_odiaeresis,	KS_eacute,
783     KC(0x57),		KS_adiaeresis,	KS_agrave,
784     KC(0x58),		KS_less,	KS_braceleft,
785     KC(0x64),		KS_y,
786     KC(0x6a),		KS_m,		KS_M,		KS_mu,
787     KC(0x6b),		KS_comma,	KS_semicolon,
788     KC(0x6c),		KS_period,	KS_colon,
789     KC(0x6d),		KS_minus,	KS_underscore,
790     KC(0x77),		KS_Control_L,
791     KC(0x7c),		KS_bracketright,KS_bracketleft,	KS_backslash,
792 };
793 
794 /* 02d Swiss-German type 5 keyboard */
795 const keysym_t sunkbd5_keydesc_sg[] = {
796     KC(0x0d),		KS_Mode_switch,
797     KC(0x1e),		KS_1,		KS_plus,	KS_bar,
798     KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
799     KC(0x20),		KS_3,		KS_asterisk,	KS_numbersign,
800     KC(0x21),		KS_4,		KS_ccedilla,	KS_asciicircum,
801     KC(0x22),		KS_5,		KS_percent,	KS_asciitilde,
802     KC(0x23),		KS_6,		KS_ampersand,
803     KC(0x24),		KS_7,		KS_slash,
804     KC(0x25),		KS_8,		KS_parenleft,
805     KC(0x26),		KS_9,		KS_parenright,
806     KC(0x27),		KS_0,		KS_equal,	KS_grave,
807     KC(0x28),		KS_apostrophe,	KS_question,	KS_dead_acute,
808     KC(0x29),		KS_dead_circumflex,KS_dead_grave,KS_dead_tilde,
809     KC(0x2a),		KS_dollar,	KS_degree,
810     KC(0x3b),		KS_z,
811     KC(0x40),		KS_udiaeresis,	KS_egrave,	KS_bracketleft,
812     KC(0x41),		KS_dead_diaeresis,KS_exclam,	KS_bracketright,
813     KC(0x56),		KS_odiaeresis,	KS_eacute,
814     KC(0x57),		KS_adiaeresis,	KS_agrave,	KS_braceleft,
815     KC(0x58),		KS_dollar,	KS_sterling,	KS_braceright,
816     KC(0x64),		KS_y,
817     KC(0x6b),		KS_comma,	KS_semicolon,
818     KC(0x6c),		KS_period,	KS_colon,
819     KC(0x6d),		KS_minus,	KS_underscore,
820     KC(0x7c),		KS_less,	KS_greater,	KS_backslash,
821 };
822 
823 /* 00e UK English type 4 keyboard */
824 const keysym_t sunkbd_keydesc_uk[] = {
825     KC(0x1e),		KS_1,		KS_exclam,	KS_bar,
826     KC(0x21),		KS_3,		KS_sterling,	KS_numbersign,
827     KC(0x28),		KS_minus,	KS_underscore,	KS_notsign,
828     KC(0x43),		KS_Mode_switch,
829 };
830 
831 /* 02e UK English type 5 keyboard */
832 const keysym_t sunkbd5_keydesc_uk[] = {
833     KC(0x0d),		KS_Mode_switch,
834     KC(0x1f),		KS_2,		KS_quotedbl,
835     KC(0x20),		KS_3,		KS_sterling,
836     KC(0x2a),		KS_grave,	KS_notsign,	KS_brokenbar,
837     KC(0x57),		KS_apostrophe,	KS_at,
838     KC(0x58),		KS_numbersign,	KS_asciitilde,
839     KC(0x7c),		KS_backslash,	KS_bar,
840 };
841 
842 /* 031 Japan type 5 keyboard */
843 const keysym_t sunkbd5_keydesc_jp[] = {
844     KC(0x1f),		KS_2,		KS_quotedbl,
845     KC(0x23),		KS_6,		KS_ampersand,
846     KC(0x24),		KS_7,		KS_apostrophe,
847     KC(0x25),		KS_8,		KS_parenleft,
848     KC(0x26),		KS_9,		KS_parenright,
849     KC(0x27),		KS_0,
850     KC(0x28),		KS_minus,	KS_equal,
851     KC(0x29),		KS_asciicircum,	KS_asciitilde,
852     KC(0x2a),		KS_yen,		KS_bar,
853     KC(0x40),		KS_at,		KS_grave,
854     KC(0x41),		KS_bracketleft,	KS_braceleft,
855     KC(0x56),		KS_semicolon,	KS_plus,
856     KC(0x57),		KS_colon,	KS_asterisk,
857     KC(0x58),		KS_bracketright,KS_braceright,
858     KC(0x7c),		KS_backslash,	KS_underscore,
859 };
860 
861 #define KBD_MAP(name, base, map) \
862     { name, base, sizeof(map)/sizeof(keysym_t), map }
863 
864 /* Supported type 4 keyboard layouts */
865 const struct wscons_keydesc sunkbd_keydesctab[] = {
866 	KBD_MAP(KB_US,			0,	sunkbd_keydesc_us),
867 	KBD_MAP(KB_BE,			KB_US,	sunkbd_keydesc_befr),
868 	KBD_MAP(KB_DE,			KB_US,	sunkbd_keydesc_de),
869 	KBD_MAP(KB_DK,			KB_US,	sunkbd_keydesc_dk),
870 	KBD_MAP(KB_ES,			KB_US,	sunkbd_keydesc_es),
871 	KBD_MAP(KB_FR,			KB_US,	sunkbd_keydesc_befr),
872 	KBD_MAP(KB_IT,			KB_US,	sunkbd_keydesc_it),
873 	KBD_MAP(KB_NL,			KB_US,	sunkbd_keydesc_nl),
874 	KBD_MAP(KB_NO,			KB_US,	sunkbd_keydesc_no),
875 	KBD_MAP(KB_PT,			KB_US,	sunkbd_keydesc_pt),
876 	KBD_MAP(KB_SF,			KB_US,	sunkbd_keydesc_sf),
877 	KBD_MAP(KB_SG,			KB_US,	sunkbd_keydesc_sg),
878 	KBD_MAP(KB_SV,			KB_US,	sunkbd_keydesc_sv),
879 	KBD_MAP(KB_SV | KB_NODEAD,	KB_SV,	sunkbd_keydesc_sv_nodead),
880 	KBD_MAP(KB_UK,			KB_US,	sunkbd_keydesc_uk),
881 	{0, 0, 0, 0},
882 };
883 
884 /* Supported type 5 keyboard layouts */
885 const struct wscons_keydesc sunkbd5_keydesctab[] = {
886 	KBD_MAP(KB_US,			0,	sunkbd_keydesc_us),
887 	KBD_MAP(KB_DE,			KB_US,	sunkbd5_keydesc_de),
888 	KBD_MAP(KB_DK,			KB_US,	sunkbd5_keydesc_dk),
889 	KBD_MAP(KB_ES,			KB_US,	sunkbd5_keydesc_es),
890 	KBD_MAP(KB_FR,			KB_US,	sunkbd5_keydesc_fr),
891 	KBD_MAP(KB_IT,			KB_US,	sunkbd5_keydesc_it),
892 	KBD_MAP(KB_JP,			KB_US,	sunkbd5_keydesc_jp),
893 	KBD_MAP(KB_NL,			KB_US,	sunkbd5_keydesc_nl),
894 	KBD_MAP(KB_NO,			KB_US,	sunkbd5_keydesc_no),
895 	KBD_MAP(KB_PT,			KB_US,	sunkbd5_keydesc_pt),
896 	KBD_MAP(KB_SF,			KB_US,	sunkbd5_keydesc_sf),
897 	KBD_MAP(KB_SG,			KB_US,	sunkbd5_keydesc_sg),
898 	KBD_MAP(KB_SV,			KB_US,	sunkbd5_keydesc_sv),
899 	KBD_MAP(KB_SV | KB_NODEAD,	KB_SV,	sunkbd_keydesc_sv_nodead),
900 	KBD_MAP(KB_UK,			KB_US,	sunkbd5_keydesc_uk),
901 	{0, 0, 0, 0},
902 };
903 
904 /*
905  * Keyboard layout to ID table
906  * References:
907  *	Sun Type 5 Keyboard Supplement Installation Guide, May 1992
908  *	http://docs.sun.com/db/doc/806-6642/6jfipqu57?a=view
909  *	http://jp.sunsolve.sun.com/handbook_pub/Systems/SSVygr/INPUT_Compact1_Keyboard.html
910  */
911 const int sunkbd_layouts[MAXSUNLAYOUT] = {
912 	/* Type 4 layouts */
913 	KB_US,	/* 000 USA */
914 	KB_US,	/* 001 same as 000 */
915 	KB_BE,	/* 002 Belgium/French */
916 	-1,	/* 003 Canada */
917 	KB_DK,	/* 004 Denmark */
918 	KB_DE,	/* 005 Germany */
919 	KB_IT,	/* 006 Italy */
920 	KB_NL,	/* 007 The Netherlands */
921 	KB_NO,	/* 008 Norway */
922 	KB_PT,	/* 009 Portugal */
923 	KB_ES,	/* 00a Latin America/Spanish */
924 	KB_SV,	/* 00b Sweden */
925 	KB_SF,	/* 00c Switzerland/French */
926 	KB_SG,	/* 00d Switzerland/German */
927 	KB_UK,	/* 00e Great Britain */
928 	-1,	/* 00f unaffected */
929 	-1,	/* 010 Korea */
930 	-1,	/* 011 Taiwan */
931 	-1,	/* 012 unaffected */
932 	-1,	/* 013 unaffected */
933 	-1,	/* 014 VT220 */
934 	-1,	/* 015 VT220 Switzerland/French */
935 	-1,	/* 016 VT220 Switzerland/German */
936 	-1,	/* 017 VT220 Switzerland/Italian */
937 	-1,	/* 018 unaffected */
938 	-1,	/* 019 Belgium */
939 	-1,	/* 01a unaffected */
940 	-1,	/* 01b unaffected */
941 	-1,	/* 01c unaffected */
942 	-1,	/* 01d unaffected */
943 	-1,	/* 01e unaffected */
944 	-1,	/* 01f unaffected */
945 	-1,	/* 020 Japan */
946 
947 	/* Type 5 layouts */
948 	KB_US,	/* 021 USA */
949 	KB_US,	/* 022 UNIX */
950 	KB_FR,	/* 023 France */
951 	KB_DK,	/* 024 Denmark */
952 	KB_DE,	/* 025 Germany */
953 	KB_IT,	/* 026 Italy */
954 	KB_NL,	/* 027 The Netherlands */
955 	KB_NO,	/* 028 Norway */
956 	KB_PT,	/* 029 Portugal */
957 	KB_ES,	/* 02a Spain */
958 	KB_SV,	/* 02b Sweden */
959 	KB_SF,	/* 02c Switzerland/French */
960 	KB_SG,	/* 02d Switzerland/German */
961 	KB_UK,	/* 02e Great Britain */
962 	-1,	/* 02f Korea */
963 	-1,	/* 030 Taiwan */
964 	KB_JP,	/* 031 Japan */
965 	-1,	/* 032 Canada/French */
966 	-1,	/* 033 Hungary */
967 	-1,	/* 034 Poland */
968 	-1,	/* 035 Czech */
969 	-1,	/* 036 Russia */
970 	-1,	/* 037 Latvia */
971 	-1,	/* 038 Turkey-Q5 */
972 	-1,	/* 039 Greece */
973 	-1,	/* 03a Arabic */
974 	-1,	/* 03b Lithuania */
975 	-1,	/* 03c Belgium */
976 	-1,	/* 03d unaffected */
977 	-1,	/* 03e Turkey-F5 */
978 	-1,	/* 03f Canada/French */
979 
980 	/* Not affected range */
981 	-1,	/* 040 */
982 	-1,	/* 041 */
983 	-1,	/* 042 */
984 	-1,	/* 043 */
985 	-1,	/* 044 */
986 	-1,	/* 045 */
987 	-1,	/* 046 */
988 	-1,	/* 047 */
989 	-1,	/* 048 */
990 	-1,	/* 049 */
991 	-1,	/* 04a */
992 	-1,	/* 04b */
993 	-1,	/* 04c */
994 	-1,	/* 04d */
995 	-1,	/* 04e */
996 	-1,	/* 04f */
997 
998 	/* ``Compact-1'' layouts */
999 	KB_US,	/* 050 USA */
1000 	KB_US,	/* 051 UNIX */
1001 	KB_FR,	/* 052 France */
1002 	KB_DK,	/* 053 Denmark */
1003 	KB_DE,	/* 054 Germany */
1004 	KB_IT,	/* 055 Italy */
1005 	KB_NL,	/* 056 The Netherlands */
1006 	KB_NO,	/* 057 Norway */
1007 	KB_PT,	/* 058 Portugal */
1008 	KB_ES,	/* 059 Spain */
1009 	KB_SV,	/* 05a Sweden */
1010 	KB_SF,	/* 05b Switzerland/French */
1011 	KB_SG,	/* 05c Switzerland/German */
1012 	KB_UK,	/* 05d Great Britain */
1013 	-1,	/* 05e Korea */
1014 	-1,	/* 05f Taiwan */
1015 	KB_JP,	/* 060 Japan */
1016 	-1,	/* 061 Canada/French */
1017 };
1018 
1019 struct wskbd_mapdata sunkbd_keymapdata = {
1020 	sunkbd_keydesctab,
1021 #ifdef SUNKBD_LAYOUT
1022 	SUNKBD_LAYOUT,
1023 #else
1024 	KB_US,
1025 #endif
1026 };
1027 
1028 struct wskbd_mapdata sunkbd5_keymapdata = {
1029 	sunkbd5_keydesctab,
1030 #ifdef SUNKBD5_LAYOUT
1031 	SUNKBD5_LAYOUT,
1032 #else
1033 	KB_US,
1034 #endif
1035 };
1036