1 /* $NetBSD: wskbdmap_next.c,v 1.4 2005/12/11 12:18:25 christos Exp $ */
4 * Copyright (c) 1997 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Juergen Hannken-Illjes.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #include <sys/cdefs.h>
33 __KERNEL_RCSID(0, "$NetBSD: wskbdmap_next.c,v 1.4 2005/12/11 12:18:25 christos Exp $");
35 #include <sys/types.h>
36 #include <dev/wscons/wsksymdef.h>
37 #include <dev/wscons/wsksymvar.h>
38 #include <arch/next68k/dev/wskbdmap_next.h>
40 #define KC(n) (0xe000 | (n)) /* see wsksymvar.h */
42 static const keysym_t nextkbd_keydesc_us
[] = {
43 /* pos command normal shifted */
44 KC(3), KS_backslash
, KS_bar
,
45 KC(4), KS_bracketright
, KS_braceright
,
46 KC(5), KS_bracketleft
, KS_braceleft
,
52 KC(12), KS_KP_Decimal
,
65 KC(28), KS_equal
, KS_plus
,
66 KC(29), KS_minus
, KS_underscore
,
67 KC(30), KS_8
, KS_asterisk
,
68 KC(31), KS_9
, KS_parenleft
,
69 KC(32), KS_0
, KS_parenright
,
73 KC(36), KS_KP_Subtract
,
74 KC(37), KS_KP_Multiply
,
75 KC(38), KS_grave
, KS_asciitilde
,
76 KC(39), KS_KP_Equal
, KS_bar
,
77 KC(40), KS_KP_Divide
, KS_backslash
,
79 KC(43), KS_apostrophe
, KS_quotedbl
,
80 KC(44), KS_semicolon
, KS_colon
,
82 KC(46), KS_comma
, KS_less
,
83 KC(47), KS_period
, KS_greater
,
84 KC(48), KS_slash
, KS_question
,
109 KC(73), KS_Cmd_Debugger
, KS_Escape
,
110 KC(74), KS_1
, KS_exclam
,
112 KC(76), KS_3
, KS_numbersign
,
113 KC(77), KS_4
, KS_dollar
,
114 KC(78), KS_7
, KS_ampersand
,
115 KC(79), KS_6
, KS_asciicircum
,
116 KC(80), KS_5
, KS_percent
,
122 KC(94), KS_Control_L
,
126 //KC(58), KS_Caps_Lock,
127 //KC(59), KS_Cmd_Screen0, KS_f1,
128 //KC(60), KS_Cmd_Screen1, KS_f2,
129 //KC(61), KS_Cmd_Screen2, KS_f3,
130 //KC(62), KS_Cmd_Screen3, KS_f4,
131 //KC(63), KS_Cmd_Screen4, KS_f5,
132 //KC(64), KS_Cmd_Screen5, KS_f6,
133 //KC(65), KS_Cmd_Screen6, KS_f7,
134 //KC(66), KS_Cmd_Screen7, KS_f8,
135 //KC(67), KS_Cmd_Screen8, KS_f9,
136 //KC(68), KS_Cmd_Screen9, KS_f10,
137 //KC(69), KS_Num_Lock,
138 //KC(70), KS_Hold_Screen,
142 /* 170, print screen, */
143 /* 183, print screen, */
144 //KC(184), KS_Alt_R, KS_Multi_key,
149 ///KC(210), KS_Insert,
150 //KC(211), KS_KP_Delete,
152 /* 220, right win, */
158 static const keysym_t nextkbd_keydesc_de
[] = {
159 /* pos normal shifted altgr shift-altgr */
160 KC(3), KS_2
, KS_quotedbl
, KS_twosuperior
,
161 KC(4), KS_3
, KS_section
, KS_threesuperior
,
162 KC(7), KS_6
, KS_ampersand
,
163 KC(8), KS_7
, KS_slash
, KS_braceleft
,
164 KC(9), KS_8
, KS_parenleft
, KS_bracketleft
,
165 KC(10), KS_9
, KS_parenright
, KS_bracketright
,
166 KC(11), KS_0
, KS_equal
, KS_braceright
,
167 KC(12), KS_ssharp
, KS_question
, KS_backslash
,
168 KC(13), KS_dead_acute
, KS_dead_grave
,
169 KC(16), KS_q
, KS_Q
, KS_at
,
171 KC(26), KS_udiaeresis
,
172 KC(27), KS_plus
, KS_asterisk
, KS_dead_tilde
,
173 KC(39), KS_odiaeresis
,
174 KC(40), KS_adiaeresis
,
175 KC(41), KS_dead_circumflex
,KS_dead_abovering
,
176 KC(43), KS_numbersign
, KS_apostrophe
,
178 KC(50), KS_m
, KS_M
, KS_mu
,
179 KC(51), KS_comma
, KS_semicolon
,
180 KC(52), KS_period
, KS_colon
,
181 KC(53), KS_minus
, KS_underscore
,
182 KC(86), KS_less
, KS_greater
, KS_bar
, KS_brokenbar
,
183 KC(184), KS_Mode_switch
, KS_Multi_key
,
186 static const keysym_t nextkbd_keydesc_de_nodead
[] = {
187 /* pos normal shifted altgr shift-altgr */
188 KC(13), KS_apostrophe
, KS_grave
,
189 KC(27), KS_plus
, KS_asterisk
, KS_asciitilde
,
190 KC(41), KS_asciicircum
, KS_degree
,
193 static const keysym_t nextkbd_keydesc_dk
[] = {
194 /* pos normal shifted altgr shift-altgr */
195 KC(3), KS_2
, KS_quotedbl
, KS_at
,
196 KC(4), KS_3
, KS_numbersign
, KS_sterling
,
197 KC(5), KS_4
, KS_currency
, KS_dollar
,
198 KC(7), KS_6
, KS_ampersand
,
199 KC(8), KS_7
, KS_slash
, KS_braceleft
,
200 KC(9), KS_8
, KS_parenleft
, KS_bracketleft
,
201 KC(10), KS_9
, KS_parenright
, KS_bracketright
,
202 KC(11), KS_0
, KS_equal
, KS_braceright
,
203 KC(12), KS_plus
, KS_question
,
204 KC(13), KS_dead_acute
, KS_dead_grave
, KS_bar
,
206 KC(27), KS_dead_diaeresis
, KS_dead_circumflex
, KS_dead_tilde
,
209 KC(41), KS_onehalf
, KS_paragraph
,
210 KC(43), KS_apostrophe
, KS_asterisk
,
211 KC(51), KS_comma
, KS_semicolon
,
212 KC(52), KS_period
, KS_colon
,
213 KC(53), KS_minus
, KS_underscore
,
214 KC(86), KS_less
, KS_greater
, KS_backslash
,
215 KC(184), KS_Mode_switch
, KS_Multi_key
,
218 static const keysym_t nextkbd_keydesc_dk_nodead
[] = {
219 /* pos normal shifted altgr shift-altgr */
220 KC(13), KS_apostrophe
, KS_grave
, KS_bar
,
221 KC(27), KS_diaeresis
, KS_asciicircum
, KS_asciitilde
,
224 static const keysym_t nextkbd_keydesc_fr
[] = {
225 /* pos normal shifted altgr shift-altgr */
226 KC(2), KS_ampersand
, KS_1
,
227 KC(3), KS_eacute
, KS_2
, KS_asciitilde
,
228 KC(4), KS_quotedbl
, KS_3
, KS_numbersign
,
229 KC(5), KS_apostrophe
, KS_4
, KS_braceleft
,
230 KC(6), KS_parenleft
, KS_5
, KS_bracketleft
,
231 KC(7), KS_minus
, KS_6
, KS_bar
,
232 KC(8), KS_egrave
, KS_7
, KS_grave
,
233 KC(9), KS_underscore
, KS_8
, KS_backslash
,
234 KC(10), KS_ccedilla
, KS_9
, KS_asciicircum
,
235 KC(11), KS_agrave
, KS_0
, KS_at
,
236 KC(12), KS_parenright
, KS_degree
, KS_bracketright
,
237 KC(13), KS_equal
, KS_plus
, KS_braceright
,
240 KC(26), KS_dead_circumflex
, KS_dead_diaeresis
,
241 KC(27), KS_dollar
, KS_sterling
, KS_currency
,
244 KC(40), KS_ugrave
, KS_percent
,
245 KC(41), KS_twosuperior
,
246 KC(43), KS_asterisk
, KS_mu
,
248 KC(50), KS_comma
, KS_question
,
249 KC(51), KS_semicolon
, KS_period
,
250 KC(52), KS_colon
, KS_slash
,
251 KC(53), KS_exclam
, KS_section
,
252 KC(86), KS_less
, KS_greater
,
253 KC(184), KS_Mode_switch
, KS_Multi_key
,
256 static const keysym_t nextkbd_keydesc_it
[] = {
257 /* pos normal shifted altgr shift-altgr */
258 KC(3), KS_2
, KS_quotedbl
, KS_twosuperior
,
259 KC(4), KS_3
, KS_sterling
, KS_threesuperior
,
260 KC(5), KS_4
, KS_dollar
,
261 KC(6), KS_5
, KS_percent
,
262 KC(7), KS_6
, KS_ampersand
,
263 KC(8), KS_7
, KS_slash
,
264 KC(9), KS_8
, KS_parenleft
,
265 KC(10), KS_9
, KS_parenright
,
266 KC(11), KS_0
, KS_equal
,
267 KC(12), KS_apostrophe
, KS_question
,
268 KC(13), KS_igrave
, KS_asciicircum
,
269 KC(26), KS_egrave
, KS_eacute
, KS_braceleft
, KS_bracketleft
,
270 KC(27), KS_plus
, KS_asterisk
, KS_braceright
, KS_bracketright
,
271 KC(39), KS_ograve
, KS_Ccedilla
, KS_at
,
272 KC(40), KS_agrave
, KS_degree
, KS_numbersign
,
273 KC(41), KS_backslash
, KS_bar
,
274 KC(43), KS_ugrave
, KS_section
,
275 KC(51), KS_comma
, KS_semicolon
,
276 KC(52), KS_period
, KS_colon
,
277 KC(53), KS_minus
, KS_underscore
,
278 KC(86), KS_less
, KS_greater
,
279 KC(184), KS_Mode_switch
, KS_Multi_key
,
282 static const keysym_t nextkbd_keydesc_us_declk
[] = {
283 /* pos normal shifted altgr shift-altgr */
284 KC(1), KS_grave
, KS_asciitilde
, /* replace escape */
285 KC(41), KS_less
, KS_greater
, /* replace grave/tilde */
286 KC(143), KS_Multi_key
, /* left compose */
287 KC(157), KS_Multi_key
, /* right compose, replace right control */
288 KC(87), KS_Cmd_Debugger
, KS_Escape
, /* replace F11 */
295 KC(70), KS_f19
, /* replace scroll lock */
296 KC(127), KS_f20
, /* replace break */
297 KC(69), KS_KP_F1
, /* replace num lock */
298 KC(181), KS_KP_F2
, /* replace divide */
299 KC(55), KS_KP_F3
, /* replace multiply */
300 KC(74), KS_KP_F4
, /* replace subtract */
302 /* keypad is numbers only - no num lock */
313 KC(83), KS_KP_Decimal
,
315 KC(206), KS_KP_Subtract
,
316 KC(78), KS_KP_Separator
, /* replace add */
317 KC(199), KS_Find
, /* replace home */
318 KC(207), KS_Select
, /* replace end */
322 #define KBD_MAP(name, base, map) \
323 { name, base, sizeof(map)/sizeof(keysym_t), map }
325 const struct wscons_keydesc nextkbd_keydesctab
[] = {
326 KBD_MAP(KB_US
, 0, nextkbd_keydesc_us
),
328 KBD_MAP(KB_DE
, KB_US
, nextkbd_keydesc_de
),
329 KBD_MAP(KB_DE
| KB_NODEAD
, KB_DE
, nextkbd_keydesc_de_nodead
),
330 KBD_MAP(KB_FR
, KB_US
, nextkbd_keydesc_fr
),
331 KBD_MAP(KB_DK
, KB_US
, nextkbd_keydesc_dk
),
332 KBD_MAP(KB_DK
| KB_NODEAD
, KB_DK
, nextkbd_keydesc_dk_nodead
),
333 KBD_MAP(KB_IT
, KB_US
, nextkbd_keydesc_it
),
334 KBD_MAP(KB_US
| KB_DECLK
, KB_US
, nextkbd_keydesc_us_declk
),