Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / amiga / dev / wskbdmap_amiga.c
blob449ab2445a2643380ec48fa5826ae977c9323a0a
1 /* $NetBSD: wskbdmap_amiga.c,v 1.8 2005/12/11 12:16:28 christos Exp $ */
3 /*-
4 * Copyright (c) 1997 The NetBSD Foundation, Inc.
5 * All rights reserved.
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
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.
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.
33 * Amiga keyboard maps for wscons.
37 * Keymaps: us, de, fr, es, sv converted from the old ite keymaps
38 * which were created by Markus Wild, Eric Delcamp, Inaki Saez
39 * and Stefan Pedersen.
41 * Copyright (c) 1993 Markus Wild
42 * All rights reserved.
44 * Redistribution and use in source and binary forms, with or without
45 * modification, are permitted provided that the following conditions
46 * are met:
47 * 1. Redistributions of source code must retain the above copyright
48 * notice, this list of conditions and the following disclaimer.
49 * 2. Redistributions in binary form must reproduce the above copyright
50 * notice, this list of conditions and the following disclaimer in the
51 * documentation and/or other materials provided with the distribution.
52 * 3. All advertising materials mentioning features or use of this software
53 * must display the following acknowledgement:
54 * This product includes software developed by Markus Wild.
55 * 4. The name of the author may not be used to endorse or promote products
56 * derived from this software without specific prior written permission
58 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
59 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
60 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
61 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
62 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
63 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
64 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
65 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
66 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
67 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
70 #include <sys/cdefs.h>
71 __KERNEL_RCSID(0, "$NetBSD: wskbdmap_amiga.c,v 1.8 2005/12/11 12:16:28 christos Exp $");
73 #include <sys/types.h>
74 #include <dev/wscons/wsksymdef.h>
75 #include <dev/wscons/wsksymvar.h>
77 #define KC(n) KS_KEYCODE(n)
79 static const keysym_t amikbd_keydesc_us[] = {
80 /* keycode normal shift alt shift-alt */
81 KC(0), KS_grave, KS_asciitilde,
82 KC(1), KS_1, KS_exclam, KS_onesuperior, KS_exclam,
83 KC(2), KS_2, KS_at, KS_twosuperior, KS_at,
84 KC(3), KS_3, KS_numbersign, KS_threesuperior,KS_numbersign,
85 KC(4), KS_4, KS_dollar, KS_cent, KS_dollar,
86 KC(5), KS_5, KS_percent, KS_onequarter, KS_percent,
87 KC(6), KS_6, KS_asciicircum, KS_onehalf, KS_asciicircum,
88 KC(7), KS_7, KS_ampersand, KS_threequarters,KS_ampersand,
89 KC(8), KS_8, KS_asterisk, KS_periodcentered,KS_asterisk,
90 KC(9), KS_9, KS_parenleft, KS_guillemotleft,KS_parenleft,
91 KC(10), KS_0, KS_parenright,KS_guillemotright,KS_parenright,
92 KC(11), KS_minus, KS_underscore,
93 KC(12), KS_equal, KS_plus,
94 KC(13), KS_backslash, KS_bar,
95 KC(15), KS_KP_0,
96 KC(16), KS_q, KS_Q, KS_aring, KS_Aring,
97 KC(17), KS_w, KS_W, KS_degree,
98 KC(18), KS_e, KS_E, KS_copyright,
99 KC(19), KS_r, KS_R, KS_registered,
100 KC(20), KS_t, KS_T, KS_thorn,
101 KC(21), KS_y, KS_Y, KS_currency, KS_yen,
102 KC(22), KS_u, KS_U, KS_mu,
103 KC(23), KS_i, KS_I, KS_exclamdown, KS_brokenbar,
104 KC(24), KS_o, KS_O, KS_oslash, KS_Ooblique,
105 KC(25), KS_p, KS_P, KS_paragraph,
106 KC(26), KS_bracketleft, KS_braceleft,
107 KC(27), KS_bracketright, KS_braceright,
108 KC(29), KS_KP_1, KS_KP_End,
109 KC(30), KS_KP_2, KS_KP_Down,
110 KC(31), KS_KP_3, KS_KP_Next,
111 KC(32), KS_a, KS_A, KS_ae, KS_AE,
112 KC(33), KS_s, KS_S, KS_ssharp, KS_section,
113 KC(34), KS_d, KS_D, KS_eth, KS_ETH,
114 KC(35), KS_f, KS_F, KS_dead_acute,
115 KC(36), KS_g, KS_G, KS_dead_grave,
116 KC(37), KS_h, KS_H, KS_dead_circumflex,
117 KC(38), KS_j, KS_J, KS_dead_tilde,
118 KC(39), KS_k, KS_K, KS_dead_diaeresis,
119 KC(40), KS_l, KS_L, KS_sterling,
120 KC(41), KS_semicolon, KS_colon,
121 KC(42), KS_apostrophe, KS_quotedbl,
122 KC(45), KS_KP_4, KS_KP_Left,
123 KC(46), KS_KP_5, KS_KP_Begin,
124 KC(47), KS_KP_6, KS_KP_Right,
125 KC(49), KS_z, KS_Z, KS_plusminus,
126 KC(50), KS_x, KS_X, KS_multiply,
127 KC(51), KS_c, KS_C, KS_ccedilla,
128 KC(52), KS_v, KS_V, KS_ordfeminine,
129 KC(53), KS_b, KS_B, KS_masculine,
130 KC(54), KS_n, KS_N, KS_hyphen,
131 KC(55), KS_m, KS_M, KS_cedilla,
132 KC(56), KS_comma, KS_less,
133 KC(57), KS_period, KS_greater,
134 KC(58), KS_slash, KS_question,
135 KC(60), KS_KP_Decimal, KS_KP_Delete,
136 KC(61), KS_KP_7, KS_KP_Home,
137 KC(62), KS_KP_8, KS_KP_Up,
138 KC(63), KS_KP_9, KS_KP_Prior,
139 KC(64), KS_space, KS_space, KS_nobreakspace,KS_nobreakspace,
141 /* keycode command normal */
142 KC(65), KS_Cmd_ResetEmul, KS_Delete,
143 KC(66), KS_Tab,
144 KC(67), KS_KP_Enter,
145 KC(68), KS_Return,
146 KC(69), KS_Cmd_Debugger, KS_Escape,
147 KC(70), KS_BackSpace,
148 KC(74), KS_KP_Subtract,
149 KC(76), KS_Up,
150 KC(77), KS_Down,
151 KC(78), KS_Right,
152 KC(79), KS_Left,
153 KC(80), KS_Cmd_Screen0, KS_f1,
154 KC(81), KS_Cmd_Screen1, KS_f2,
155 KC(82), KS_Cmd_Screen2, KS_f3,
156 KC(83), KS_Cmd_Screen3, KS_f4,
157 KC(84), KS_Cmd_Screen4, KS_f5,
158 KC(85), KS_Cmd_Screen5, KS_f6,
159 KC(86), KS_Cmd_Screen6, KS_f7,
160 KC(87), KS_Cmd_Screen7, KS_f8,
161 KC(88), KS_Cmd_Screen8, KS_f9,
162 KC(89), KS_Cmd_Screen9, KS_f10,
163 KC(90), KS_parenleft,
164 KC(91), KS_parenright,
165 KC(92), KS_KP_Divide,
166 KC(93), KS_KP_Multiply,
167 KC(94), KS_KP_Add,
168 KC(95), KS_Help,
169 KC(96), KS_Shift_L,
170 KC(97), KS_Shift_R,
171 KC(99), KS_Cmd1, KS_Control_L,
172 KC(100), KS_Cmd2, KS_Mode_switch,
173 KC(101), KS_Mode_switch,
174 KC(102), KS_Cmd, KS_Alt_L,
175 KC(103), KS_Multi_key,
178 static const keysym_t amikbd_keydesc_de[] = {
179 /* keycode normal shift alt shift-alt */
180 KC(2), KS_2, KS_quotedbl, KS_at, KS_twosuperior,
181 KC(3), KS_3, KS_section, KS_threesuperior,KS_numbersign,
182 KC(4), KS_4, KS_dollar, KS_degree, KS_cent,
183 KC(6), KS_6, KS_ampersand, KS_onehalf, KS_asciicircum,
184 KC(7), KS_7, KS_slash, KS_threequarters,KS_ampersand,
185 KC(8), KS_8, KS_parenleft, KS_periodcentered,KS_asterisk,
186 KC(9), KS_9, KS_parenright, KS_guillemotleft,KS_parenleft,
187 KC(10), KS_0, KS_equal, KS_guillemotright,KS_parenright,
188 KC(11), KS_ssharp, KS_question, KS_minus, KS_underscore,
189 KC(12), KS_dead_acute, KS_dead_grave, KS_equal, KS_plus,
190 KC(21), KS_z, KS_Z, KS_currency, KS_yen,
191 KC(26), KS_udiaeresis, KS_Udiaeresis, KS_bracketleft, KS_braceleft,
192 KC(27), KS_plus, KS_asterisk, KS_bracketright,KS_braceright,
193 KC(41), KS_odiaeresis, KS_Odiaeresis, KS_semicolon, KS_colon,
194 KC(42), KS_adiaeresis, KS_Adiaeresis, KS_apostrophe, KS_quotedbl,
195 KC(43), KS_numbersign, KS_asciicircum,
196 KC(48), KS_less, KS_greater,
197 KC(49), KS_y, KS_Y, KS_plusminus, KS_notsign,
198 KC(50), KS_x, KS_X, KS_multiply, KS_division,
199 KC(51), KS_c, KS_C, KS_ccedilla, KS_Ccedilla,
200 KC(54), KS_n, KS_N, KS_hyphen, KS_macron,
201 KC(55), KS_m, KS_M, KS_cedilla, KS_questiondown,
202 KC(56), KS_comma, KS_semicolon, KS_comma, KS_less,
203 KC(57), KS_period, KS_colon, KS_period, KS_greater,
204 KC(58), KS_minus, KS_underscore, KS_slash, KS_question,
205 KC(90), KS_bracketleft, KS_braceleft,
206 KC(91), KS_bracketright, KS_braceright,
209 static const keysym_t amikbd_keydesc_de_nodead[] = {
210 /* keycode normal shift alt shift-alt */
211 KC(12), KS_apostrophe, KS_grave, KS_equal, KS_plus,
214 static const keysym_t amikbd_keydesc_pl[] = {
215 /* pos normal shifted altgr shift-altgr */
216 KC(18), KS_e, KS_E, KS_ecircumflex, KS_Ecircumflex,
217 KC(24), KS_o, KS_O, KS_oacute, KS_Oacute,
218 KC(32), KS_a, KS_A, KS_plusminus, KS_exclamdown,
219 KC(33), KS_s, KS_S, KS_paragraph, KS_brokenbar,
220 KC(40), KS_l, KS_L, KS_threesuperior, KS_sterling,
221 KC(49), KS_z, KS_Z, KS_questiondown, KS_macron,
222 KC(50), KS_x, KS_X, KS_onequarter, KS_notsign,
223 KC(51), KS_c, KS_C, KS_ae, KS_AE,
224 KC(54), KS_n, KS_N, KS_ntilde, KS_Ntilde,
227 static const keysym_t amikbd_keydesc_fr[] = {
228 /* keycode normal shift alt shift-alt */
229 KC(1), KS_ampersand, KS_1, KS_onesuperior, KS_exclam,
230 KC(2), KS_eacute, KS_2, KS_twosuperior, KS_at,
231 KC(3), KS_quotedbl, KS_3, KS_threesuperior,KS_numbersign,
232 KC(4), KS_apostrophe, KS_4, KS_cent, KS_dollar,
233 KC(5), KS_parenleft, KS_5, KS_onequarter, KS_percent,
234 KC(6), KS_section, KS_6, KS_onehalf, KS_asciicircum,
235 KC(7), KS_egrave, KS_7, KS_threequarters,KS_ampersand,
236 KC(8), KS_exclam, KS_8, KS_periodcentered,KS_asterisk,
237 KC(9), KS_ccedilla, KS_9, KS_guillemotleft,KS_parenleft,
238 KC(10), KS_agrave, KS_0, KS_guillemotright,KS_parenright,
239 KC(11), KS_parenright, KS_degree, KS_minus, KS_underscore,
240 KC(12), KS_minus, KS_underscore, KS_equal, KS_plus,
241 KC(16), KS_a, KS_A, KS_aring, KS_Aring,
242 KC(17), KS_z, KS_Z, KS_degree, KS_degree,
243 KC(26), KS_dead_circumflex,KS_dead_diaeresis,KS_bracketleft,KS_braceleft,
244 KC(27), KS_dollar, KS_asterisk, KS_bracketright,KS_braceright,
245 KC(32), KS_q, KS_Q, KS_ae, KS_AE,
246 KC(41), KS_m, KS_M, KS_semicolon, KS_semicolon,
247 KC(42), KS_Ugrave, KS_percent, KS_apostrophe, KS_quotedbl,
248 KC(43), KS_mu, KS_sterling, KS_mu, KS_sterling,
249 KC(48), KS_less, KS_greater, KS_less, KS_greater,
250 KC(49), KS_w, KS_W, KS_plusminus, KS_notsign,
251 KC(50), KS_x, KS_X, KS_multiply, KS_division,
252 KC(54), KS_n, KS_N, KS_hyphen, KS_macron,
253 KC(55), KS_comma, KS_question, KS_cedilla, KS_questiondown,
254 KC(56), KS_semicolon, KS_period, KS_comma, KS_less,
255 KC(57), KS_colon, KS_slash, KS_period, KS_greater,
256 KC(58), KS_equal, KS_plus, KS_slash, KS_question,
257 KC(90), KS_bracketleft, KS_braceleft,
258 KC(91), KS_bracketright, KS_braceright,
261 static const keysym_t amikbd_keydesc_fr_nodead[] = {
262 /* keycode normal shift alt shift-alt */
263 KC(26), KS_asciicircum, KS_diaeresis, KS_bracketleft, KS_braceleft,
266 static const keysym_t amikbd_keydesc_dk[] = {
267 /* pos normal shifted altgr shift-altgr */
268 KC(3), KS_3, KS_numbersign, KS_threesuperior,KS_numbersign,
269 KC(4), KS_4, KS_currency, KS_cent, KS_dollar,
270 KC(41), KS_ae, KS_AE, KS_semicolon, KS_colon,
271 KC(42), KS_oslash, KS_Ooblique, KS_apostrophe, KS_quotedbl,
274 static const keysym_t amikbd_keydesc_sv[] = {
275 /* keycode normal shift alt shift-alt */
276 KC(2), KS_2, KS_quotedbl, KS_twosuperior, KS_at,
277 KC(3), KS_3, KS_sterling, KS_threesuperior,KS_numbersign,
278 KC(6), KS_6, KS_ampersand, KS_onehalf, KS_asciicircum,
279 KC(7), KS_7, KS_slash, KS_threequarters,KS_ampersand,
280 KC(8), KS_8, KS_parenleft, KS_periodcentered,KS_asterisk,
281 KC(9), KS_9, KS_parenright, KS_guillemotleft,KS_parenleft,
282 KC(10), KS_0, KS_equal, KS_guillemotright,KS_parenright,
283 KC(11), KS_plus, KS_question, KS_minus, KS_underscore,
284 KC(12), KS_dead_acute, KS_dead_grave, KS_equal, KS_plus,
285 KC(26), KS_acircumflex, KS_Acircumflex, KS_bracketleft, KS_braceleft,
286 KC(27), KS_dead_diaeresis,KS_dead_circumflex,KS_bracketright,KS_braceright,
287 KC(41), KS_odiaeresis, KS_Odiaeresis, KS_semicolon, KS_colon,
288 KC(42), KS_adiaeresis, KS_Adiaeresis, KS_apostrophe, KS_quotedbl,
289 KC(43), KS_apostrophe, KS_asterisk,
290 KC(48), KS_less, KS_greater,
291 KC(56), KS_comma, KS_semicolon, KS_comma, KS_less,
292 KC(57), KS_period, KS_colon, KS_period, KS_greater,
293 KC(58), KS_minus, KS_underscore, KS_slash, KS_question,
294 KC(90), KS_bracketleft, KS_braceleft,
295 KC(91), KS_bracketright, KS_braceright,
298 static const keysym_t amikbd_keydesc_sv_nodead[] = {
299 /* keycode normal shift alt shift-alt */
300 KC(12), KS_apostrophe, KS_grave, KS_equal, KS_plus,
301 KC(27), KS_diaeresis, KS_asciicircum, KS_bracketleft, KS_braceleft,
304 static const keysym_t amikbd_keydesc_no[] = {
305 /* pos normal shifted altgr shift-altgr */
306 KC(41), KS_oslash, KS_Ooblique, KS_semicolon, KS_colon,
307 KC(42), KS_ae, KS_AE, KS_apostrophe, KS_quotedbl,
310 static const keysym_t amikbd_keydesc_es[] = {
311 /* keycode normal shift alt shift-alt */
312 KC(1), KS_1, KS_exclamdown, KS_onesuperior, KS_exclam,
313 KC(2), KS_2, KS_questiondown,KS_twosuperior, KS_at,
314 KC(4), KS_4, KS_dollar, KS_cent, KS_degree,
315 KC(5), KS_5, KS_percent, KS_onequarter, KS_percent,
316 KC(6), KS_6, KS_slash, KS_onehalf, KS_asciicircum,
317 KC(26), KS_dead_acute, KS_dead_diaeresis,KS_bracketleft,KS_braceleft,
318 KC(27), KS_dead_grave,KS_dead_circumflex,KS_bracketright,KS_braceright,
319 KC(41), KS_ntilde, KS_Ntilde, KS_semicolon, KS_colon,
320 KC(42), KS_semicolon, KS_colon, KS_apostrophe, KS_quotedbl,
321 KC(43), KS_ccedilla, KS_Ccedilla, KS_ordfeminine, KS_masculine,
322 KC(48), KS_less, KS_greater,KS_guillemotleft,KS_guillemotright,
323 KC(49), KS_z, KS_Z, KS_plusminus, KS_notsign,
324 KC(50), KS_x, KS_X, KS_multiply, KS_division,
325 KC(54), KS_n, KS_N, KS_hyphen, KS_macron,
326 KC(55), KS_m, KS_M, KS_cedilla, KS_questiondown,
327 KC(56), KS_comma, KS_question, KS_comma, KS_less,
328 KC(57), KS_period, KS_exclam, KS_period, KS_greater,
329 KC(58), KS_apostrophe, KS_quotedbl, KS_slash, KS_question,
330 KC(90), KS_bracketleft, KS_braceleft,
331 KC(91), KS_bracketright, KS_braceright,
334 static const keysym_t amikbd_keydesc_es_nodead[] = {
335 /* keycode normal shift alt shift-alt */
336 KC(26), KS_apostrophe, KS_diaeresis, KS_bracketleft, KS_braceleft,
337 KC(27), KS_grave, KS_asciicircum, KS_bracketright,KS_braceright,
340 #define KBD_MAP(name, base, map) \
341 { name, base, sizeof(map)/sizeof(keysym_t), map }
343 const struct wscons_keydesc amigakbd_keydesctab[] = {
344 KBD_MAP(KB_US, 0, amikbd_keydesc_us),
345 KBD_MAP(KB_DE, KB_US, amikbd_keydesc_de),
346 KBD_MAP(KB_DE | KB_NODEAD, KB_DE, amikbd_keydesc_de_nodead),
347 KBD_MAP(KB_FR, KB_US, amikbd_keydesc_fr),
348 KBD_MAP(KB_FR | KB_NODEAD, KB_FR, amikbd_keydesc_fr_nodead),
349 KBD_MAP(KB_DK, KB_SV, amikbd_keydesc_dk),
350 KBD_MAP(KB_DK | KB_NODEAD, KB_DK, amikbd_keydesc_sv_nodead),
351 KBD_MAP(KB_PL, KB_US, amikbd_keydesc_pl),
352 KBD_MAP(KB_SV, KB_US, amikbd_keydesc_sv),
353 KBD_MAP(KB_SV | KB_NODEAD, KB_SV, amikbd_keydesc_sv_nodead),
354 KBD_MAP(KB_NO, KB_SV, amikbd_keydesc_no),
355 KBD_MAP(KB_NO | KB_NODEAD, KB_NO, amikbd_keydesc_sv_nodead),
356 KBD_MAP(KB_ES, KB_US, amikbd_keydesc_es),
357 KBD_MAP(KB_ES | KB_NODEAD, KB_ES, amikbd_keydesc_es_nodead),
358 { 0, 0, 0, 0}
361 #undef KBD_MAP
362 #undef KC