wskbdmap_next.c revision 1.2 1 /* $NetBSD: wskbdmap_next.c,v 1.2 1999/03/26 04:15:27 dbj Exp $ */
2
3 /*-
4 * Copyright (c) 1997 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Juergen Hannken-Illjes.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
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.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #include <sys/types.h>
40 #include <dev/wscons/wsksymdef.h>
41 #include <dev/wscons/wsksymvar.h>
42 #include <arch/next68k/dev/wskbdmap_next.h>
43
44 #define KC(n) (0xe000 | (n)) /* see wsksymvar.h */
45
46 static const keysym_t nextkbd_keydesc_us[] = {
47 /* pos command normal shifted */
48 KC(3), KS_backslash, KS_bar,
49 KC(4), KS_bracketright, KS_braceright,
50 KC(5), KS_bracketleft, KS_braceleft,
51 KC(6), KS_i,
52 KC(7), KS_o,
53 KC(8), KS_p,
54 KC(9), KS_Left,
55 KC(11), KS_KP_0,
56 KC(12), KS_KP_Decimal,
57 KC(13), KS_KP_Enter,
58 KC(15), KS_Down,
59 KC(16), KS_Right,
60 KC(17), KS_KP_1,
61 KC(18), KS_KP_4,
62 KC(19), KS_KP_6,
63 KC(20), KS_KP_3,
64 KC(21), KS_KP_Add,
65 KC(22), KS_Up,
66 KC(23), KS_KP_2,
67 KC(24), KS_KP_5,
68 KC(27), KS_Delete,
69 KC(28), KS_equal, KS_plus,
70 KC(29), KS_minus, KS_underscore,
71 KC(30), KS_8, KS_asterisk,
72 KC(31), KS_9, KS_parenleft,
73 KC(32), KS_0, KS_parenright,
74 KC(33), KS_KP_7,
75 KC(34), KS_KP_8,
76 KC(35), KS_KP_9,
77 KC(36), KS_KP_Subtract,
78 KC(37), KS_KP_Multiply,
79 KC(38), KS_grave, KS_asciitilde,
80 KC(39), KS_KP_Equal, KS_bar,
81 KC(40), KS_KP_Divide, KS_backslash,
82 KC(42), KS_Return,
83 KC(43), KS_apostrophe, KS_quotedbl,
84 KC(44), KS_semicolon, KS_colon,
85 KC(45), KS_l,
86 KC(46), KS_comma, KS_less,
87 KC(47), KS_period, KS_greater,
88 KC(48), KS_slash, KS_question,
89 KC(49), KS_z,
90 KC(50), KS_x,
91 KC(51), KS_c,
92 KC(52), KS_v,
93 KC(53), KS_b,
94 KC(54), KS_m,
95 KC(55), KS_n,
96 KC(56), KS_space,
97 KC(57), KS_a,
98 KC(58), KS_s,
99 KC(59), KS_d,
100 KC(60), KS_f,
101 KC(61), KS_g,
102 KC(62), KS_k,
103 KC(63), KS_j,
104 KC(64), KS_h,
105 KC(65), KS_Tab,
106 KC(66), KS_q,
107 KC(67), KS_w,
108 KC(68), KS_e,
109 KC(69), KS_r,
110 KC(70), KS_u,
111 KC(71), KS_y,
112 KC(72), KS_t,
113 KC(73), KS_Cmd_Debugger, KS_Escape,
114 KC(74), KS_1, KS_exclam,
115 KC(75), KS_2, KS_at,
116 KC(76), KS_3, KS_numbersign,
117 KC(77), KS_4, KS_dollar,
118 KC(78), KS_7, KS_ampersand,
119 KC(79), KS_6, KS_asciicircum,
120 KC(80), KS_5, KS_percent,
121
122 KC(90), KS_Shift_L,
123 KC(91), KS_Shift_R,
124 KC(92), KS_Alt_L,
125 KC(93), KS_Alt_R,
126 KC(94), KS_Control_L,
127 KC(95), KS_Cmd1,
128 KC(96), KS_Cmd2,
129 #if 0
130 //KC(58), KS_Caps_Lock,
131 //KC(59), KS_Cmd_Screen0, KS_f1,
132 //KC(60), KS_Cmd_Screen1, KS_f2,
133 //KC(61), KS_Cmd_Screen2, KS_f3,
134 //KC(62), KS_Cmd_Screen3, KS_f4,
135 //KC(63), KS_Cmd_Screen4, KS_f5,
136 //KC(64), KS_Cmd_Screen5, KS_f6,
137 //KC(65), KS_Cmd_Screen6, KS_f7,
138 //KC(66), KS_Cmd_Screen7, KS_f8,
139 //KC(67), KS_Cmd_Screen8, KS_f9,
140 //KC(68), KS_Cmd_Screen9, KS_f10,
141 //KC(69), KS_Num_Lock,
142 //KC(70), KS_Hold_Screen,
143 //KC(87), KS_f11,
144 //KC(88), KS_f12,
145 /* 127, break, */
146 /* 170, print screen, */
147 /* 183, print screen, */
148 //KC(184), KS_Alt_R, KS_Multi_key,
149 //KC(199), KS_Home,
150 //KC(201), KS_Prior,
151 //K/C(207), KS_End,
152 //K/C(209), KS_Next,
153 ///KC(210), KS_Insert,
154 //KC(211), KS_KP_Delete,
155 /* 219, left win, */
156 /* 220, right win, */
157 /* 221, menu, */
158 #endif
159 };
160
161 #if 0
162 static const keysym_t nextkbd_keydesc_de[] = {
163 /* pos normal shifted altgr shift-altgr */
164 KC(3), KS_2, KS_quotedbl, KS_twosuperior,
165 KC(4), KS_3, KS_section, KS_threesuperior,
166 KC(7), KS_6, KS_ampersand,
167 KC(8), KS_7, KS_slash, KS_braceleft,
168 KC(9), KS_8, KS_parenleft, KS_bracketleft,
169 KC(10), KS_9, KS_parenright, KS_bracketright,
170 KC(11), KS_0, KS_equal, KS_braceright,
171 KC(12), KS_ssharp, KS_question, KS_backslash,
172 KC(13), KS_dead_acute, KS_dead_grave,
173 KC(16), KS_q, KS_Q, KS_at,
174 KC(21), KS_z,
175 KC(26), KS_udiaeresis,
176 KC(27), KS_plus, KS_asterisk, KS_dead_tilde,
177 KC(39), KS_odiaeresis,
178 KC(40), KS_adiaeresis,
179 KC(41), KS_dead_circumflex,KS_dead_abovering,
180 KC(43), KS_numbersign, KS_apostrophe,
181 KC(44), KS_y,
182 KC(50), KS_m, KS_M, KS_mu,
183 KC(51), KS_comma, KS_semicolon,
184 KC(52), KS_period, KS_colon,
185 KC(53), KS_minus, KS_underscore,
186 KC(86), KS_less, KS_greater, KS_bar, KS_brokenbar,
187 KC(184), KS_Mode_switch, KS_Multi_key,
188 };
189
190 static const keysym_t nextkbd_keydesc_de_nodead[] = {
191 /* pos normal shifted altgr shift-altgr */
192 KC(13), KS_apostrophe, KS_grave,
193 KC(27), KS_plus, KS_asterisk, KS_asciitilde,
194 KC(41), KS_asciicircum, KS_degree,
195 };
196
197 static const keysym_t nextkbd_keydesc_dk[] = {
198 /* pos normal shifted altgr shift-altgr */
199 KC(3), KS_2, KS_quotedbl, KS_at,
200 KC(4), KS_3, KS_numbersign, KS_sterling,
201 KC(5), KS_4, KS_currency, KS_dollar,
202 KC(7), KS_6, KS_ampersand,
203 KC(8), KS_7, KS_slash, KS_braceleft,
204 KC(9), KS_8, KS_parenleft, KS_bracketleft,
205 KC(10), KS_9, KS_parenright, KS_bracketright,
206 KC(11), KS_0, KS_equal, KS_braceright,
207 KC(12), KS_plus, KS_question,
208 KC(13), KS_dead_acute, KS_dead_grave, KS_bar,
209 KC(26), KS_aring,
210 KC(27), KS_dead_diaeresis, KS_dead_circumflex, KS_dead_tilde,
211 KC(39), KS_ae,
212 KC(40), KS_oslash,
213 KC(41), KS_onehalf, KS_paragraph,
214 KC(43), KS_apostrophe, KS_asterisk,
215 KC(51), KS_comma, KS_semicolon,
216 KC(52), KS_period, KS_colon,
217 KC(53), KS_minus, KS_underscore,
218 KC(86), KS_less, KS_greater, KS_backslash,
219 KC(184), KS_Mode_switch, KS_Multi_key,
220 };
221
222 static const keysym_t nextkbd_keydesc_dk_nodead[] = {
223 /* pos normal shifted altgr shift-altgr */
224 KC(13), KS_apostrophe, KS_grave, KS_bar,
225 KC(27), KS_diaeresis, KS_asciicircum, KS_asciitilde,
226 };
227
228 static const keysym_t nextkbd_keydesc_fr[] = {
229 /* pos normal shifted altgr shift-altgr */
230 KC(2), KS_ampersand, KS_1,
231 KC(3), KS_eacute, KS_2, KS_asciitilde,
232 KC(4), KS_quotedbl, KS_3, KS_numbersign,
233 KC(5), KS_apostrophe, KS_4, KS_braceleft,
234 KC(6), KS_parenleft, KS_5, KS_bracketleft,
235 KC(7), KS_minus, KS_6, KS_bar,
236 KC(8), KS_egrave, KS_7, KS_grave,
237 KC(9), KS_underscore, KS_8, KS_backslash,
238 KC(10), KS_ccedilla, KS_9, KS_asciicircum,
239 KC(11), KS_agrave, KS_0, KS_at,
240 KC(12), KS_parenright, KS_degree, KS_bracketright,
241 KC(13), KS_equal, KS_plus, KS_braceright,
242 KC(16), KS_a,
243 KC(17), KS_z,
244 KC(26), KS_dead_circumflex, KS_dead_diaeresis,
245 KC(27), KS_dollar, KS_sterling, KS_currency,
246 KC(30), KS_q,
247 KC(39), KS_m,
248 KC(40), KS_ugrave, KS_percent,
249 KC(41), KS_twosuperior,
250 KC(43), KS_asterisk, KS_mu,
251 KC(44), KS_w,
252 KC(50), KS_comma, KS_question,
253 KC(51), KS_semicolon, KS_period,
254 KC(52), KS_colon, KS_slash,
255 KC(53), KS_exclam, KS_section,
256 KC(86), KS_less, KS_greater,
257 KC(184), KS_Mode_switch, KS_Multi_key,
258 };
259
260 static const keysym_t nextkbd_keydesc_it[] = {
261 /* pos normal shifted altgr shift-altgr */
262 KC(3), KS_2, KS_quotedbl, KS_twosuperior,
263 KC(4), KS_3, KS_sterling, KS_threesuperior,
264 KC(5), KS_4, KS_dollar,
265 KC(6), KS_5, KS_percent,
266 KC(7), KS_6, KS_ampersand,
267 KC(8), KS_7, KS_slash,
268 KC(9), KS_8, KS_parenleft,
269 KC(10), KS_9, KS_parenright,
270 KC(11), KS_0, KS_equal,
271 KC(12), KS_apostrophe, KS_question,
272 KC(13), KS_igrave, KS_asciicircum,
273 KC(26), KS_egrave, KS_eacute, KS_braceleft, KS_bracketleft,
274 KC(27), KS_plus, KS_asterisk, KS_braceright, KS_bracketright,
275 KC(39), KS_ograve, KS_Ccedilla, KS_at,
276 KC(40), KS_agrave, KS_degree, KS_numbersign,
277 KC(41), KS_backslash, KS_bar,
278 KC(43), KS_ugrave, KS_section,
279 KC(51), KS_comma, KS_semicolon,
280 KC(52), KS_period, KS_colon,
281 KC(53), KS_minus, KS_underscore,
282 KC(86), KS_less, KS_greater,
283 KC(184), KS_Mode_switch, KS_Multi_key,
284 };
285
286 static const keysym_t nextkbd_keydesc_us_declk[] = {
287 /* pos normal shifted altgr shift-altgr */
288 KC(1), KS_grave, KS_asciitilde, /* replace escape */
289 KC(41), KS_less, KS_greater, /* replace grave/tilde */
290 KC(143), KS_Multi_key, /* left compose */
291 KC(157), KS_Multi_key, /* right compose, replace right control */
292 KC(87), KS_Cmd_Debugger, KS_Escape, /* replace F11 */
293 KC(189), KS_f13,
294 KC(190), KS_f14,
295 KC(191), KS_Help,
296 KC(192), KS_Execute,
297 KC(193), KS_f17,
298 KC(183), KS_f18,
299 KC(70), KS_f19, /* replace scroll lock */
300 KC(127), KS_f20, /* replace break */
301 KC(69), KS_KP_F1, /* replace num lock */
302 KC(181), KS_KP_F2, /* replace divide */
303 KC(55), KS_KP_F3, /* replace multiply */
304 KC(74), KS_KP_F4, /* replace subtract */
305
306 /* keypad is numbers only - no num lock */
307 KC(71), KS_KP_7,
308 KC(72), KS_KP_8,
309 KC(73), KS_KP_9,
310 KC(75), KS_KP_4,
311 KC(76), KS_KP_5,
312 KC(77), KS_KP_6,
313 KC(79), KS_KP_1,
314 KC(80), KS_KP_2,
315 KC(81), KS_KP_3,
316 KC(82), KS_KP_0,
317 KC(83), KS_KP_Decimal,
318
319 KC(206), KS_KP_Subtract,
320 KC(78), KS_KP_Separator, /* replace add */
321 KC(199), KS_Find, /* replace home */
322 KC(207), KS_Select, /* replace end */
323 };
324 #endif
325
326 #define KBD_MAP(name, base, map) \
327 { name, base, sizeof(map)/sizeof(keysym_t), map }
328
329 const struct wscons_keydesc nextkbd_keydesctab[] = {
330 KBD_MAP(KB_US, 0, nextkbd_keydesc_us),
331 #if 0
332 KBD_MAP(KB_DE, KB_US, nextkbd_keydesc_de),
333 KBD_MAP(KB_DE | KB_NODEAD, KB_DE, nextkbd_keydesc_de_nodead),
334 KBD_MAP(KB_FR, KB_US, nextkbd_keydesc_fr),
335 KBD_MAP(KB_DK, KB_US, nextkbd_keydesc_dk),
336 KBD_MAP(KB_DK | KB_NODEAD, KB_DK, nextkbd_keydesc_dk_nodead),
337 KBD_MAP(KB_IT, KB_US, nextkbd_keydesc_it),
338 KBD_MAP(KB_US | KB_DECLK, KB_US, nextkbd_keydesc_us_declk),
339 #endif
340 {0, 0, 0, 0}
341 };
342
343 #undef KBD_MAP
344 #undef KC
345