1 /* $NetBSD: arckbdmap.c,v 1.2.14.3 2004/09/21 13:11:20 skrll Exp $ */
3 * Copyright (c) 1998 Ben Harris
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 * arckbdmap.c - Archimedes keyboard maps
32 #include <sys/cdefs.h>
33 __KERNEL_RCSID(0, "$NetBSD: arckbdmap.c,v 1.2.14.3 2004/09/21 13:11:20 skrll Exp $");
35 #include <sys/types.h>
36 #include <sys/device.h>
37 #include <dev/wscons/wsksymdef.h>
38 #include <dev/wscons/wsksymvar.h>
39 #include <arch/acorn26/ioc/arckbdvar.h>
40 #include <arch/acorn26/ioc/arckbdreg.h>
42 #define KC(n) (0xe000 | (n)) /* see wsksymdef.h */
44 /* Arc keycodes are 0xrc where r and c are the row and column codes */
46 static const keysym_t arckbd_keydesc_uk
[] = {
47 /* pos command normal shifted */
48 KC(0x00), KS_Cmd_Debugger
,KS_Escape
,
49 KC(0x01), KS_Cmd_Screen0
, KS_f1
,
50 KC(0x02), KS_Cmd_Screen1
, KS_f2
,
51 KC(0x03), KS_Cmd_Screen2
, KS_f3
,
52 KC(0x04), KS_Cmd_Screen3
, KS_f4
,
53 KC(0x05), KS_Cmd_Screen4
, KS_f5
,
54 KC(0x06), KS_Cmd_Screen5
, KS_f6
,
55 KC(0x07), KS_Cmd_Screen6
, KS_f7
,
56 KC(0x08), KS_Cmd_Screen7
, KS_f8
,
57 KC(0x09), KS_Cmd_Screen8
, KS_f9
,
58 KC(0x0a), KS_Cmd_Screen9
, KS_f10
,
61 KC(0x0d), KS_voidSymbol
, /* print: no keysym yet */
62 KC(0x0e), KS_Hold_Screen
, /* scroll lock */
63 KC(0x0f), KS_voidSymbol
, /* break: no keysym yet */
65 KC(0x10), KS_grave
, KS_asciitilde
,
66 KC(0x11), KS_1
, KS_exclam
,
67 KC(0x12), KS_2
, KS_at
,
68 KC(0x13), KS_3
, KS_numbersign
,
69 KC(0x14), KS_4
, KS_dollar
,
70 KC(0x15), KS_5
, KS_percent
,
71 KC(0x16), KS_6
, KS_asciicircum
,
72 KC(0x17), KS_7
, KS_ampersand
,
73 KC(0x18), KS_8
, KS_asterisk
,
74 KC(0x19), KS_9
, KS_parenleft
,
75 KC(0x1a), KS_0
, KS_parenright
,
76 KC(0x1b), KS_minus
, KS_underscore
,
77 KC(0x1c), KS_equal
, KS_plus
,
78 KC(0x1d), KS_sterling
, KS_currency
,
79 KC(0x1e), KS_BackSpace
,
83 KC(0x22), KS_Num_Lock
,
84 KC(0x23), KS_KP_Divide
,
85 KC(0x24), KS_KP_Multiply
,
86 KC(0x25), KS_KP_Numbersign
,
99 KC(0x31), KS_bracketleft
, KS_braceleft
,
100 KC(0x32), KS_bracketright
,KS_braceright
,
101 KC(0x33), KS_backslash
, KS_bar
,
103 KC(0x35), KS_End
, /* really Copy */
108 KC(0x3a), KS_KP_Subtract
,
110 KC(0x3b), KS_Cmd1
, KS_Control_L
,
120 KC(0x45), KS_semicolon
, KS_colon
,
121 KC(0x46), KS_apostrophe
, KS_quotedbl
,
128 KC(0x4c), KS_Shift_L
,
136 KC(0x55), KS_comma
, KS_less
,
137 KC(0x56), KS_period
, KS_greater
,
138 KC(0x57), KS_slash
, KS_question
,
139 KC(0x58), KS_Shift_R
,
145 KC(0x5d), KS_Caps_Lock
,
146 KC(0x5e), KS_Cmd2
, KS_Alt_L
,
149 KC(0x61), KS_Control_R
,
154 KC(0x66), KS_KP_Decimal
,
155 KC(0x67), KS_KP_Enter
,
158 KC(0x70), KS_voidSymbol
, /* left */
159 KC(0x71), KS_voidSymbol
, /* middle */
160 KC(0x72), KS_voidSymbol
, /* right */
163 static const keysym_t arckbd_keydesc_no
[] = {
165 KC(0x12), KS_2
, KS_quotedbl
, KS_apostrophe
,
166 KC(0x14), KS_4
, KS_dollar
, KS_currency
,
167 KC(0x16), KS_6
, KS_ampersand
,
168 KC(0x17), KS_7
, KS_slash
, KS_braceleft
,
169 KC(0x18), KS_8
, KS_parenleft
, KS_bracketleft
,
170 KC(0x19), KS_9
, KS_parenright
, KS_bracketright
,
171 KC(0x1a), KS_0
, KS_equal
, KS_braceright
,
172 KC(0x1b), KS_plus
, KS_question
,
173 KC(0x1c), KS_less
, KS_greater
, KS_bar
,
174 KC(0x1d), KS_at
, KS_sterling
,
176 KC(0x32), KS_asciicircum
, KS_asterisk
,
179 KC(0x4d), KS_less
, KS_greater
,
180 KC(0x55), KS_comma
, KS_semicolon
,
181 KC(0x56), KS_period
, KS_colon
,
182 KC(0x57), KS_minus
, KS_underscore
,
185 static const keysym_t arckbd_keydesc_se
[] = {
187 /* pos normal shifted altgred */
188 KC(0x32), KS_udiaeresis
,
189 KC(0x33), KS_asciicircum
, KS_asterisk
, KS_backslash
,
190 KC(0x45), KS_odiaeresis
,
191 KC(0x46), KS_adiaeresis
,
194 static const keysym_t arckbd_keydesc_de
[] = {
196 /* pos normal shifted altgred */
197 KC(0x10), KS_asciicircum
, KS_degree
,
198 KC(0x12), KS_2
, KS_quotedbl
,
199 KC(0x13), KS_3
, KS_section
,
200 KC(0x14), KS_4
, KS_dollar
,
201 KC(0x1b), KS_ssharp
, KS_question
, KS_backslash
,
202 KC(0x1c), KS_dead_acute
, KS_dead_grave
,
203 KC(0x27), KS_q
, KS_Q
, KS_at
,
205 KC(0x31), KS_udiaeresis
,
206 KC(0x32), KS_plus
, KS_asterisk
, KS_asciitilde
,
207 KC(0x33), KS_numbersign
, KS_apostrophe
,
209 KC(0x54), KS_m
, KS_M
, KS_mu
,
212 #define KBD_MAP(name, base, map) \
213 { name, base, sizeof(map)/sizeof(keysym_t), map }
215 static const struct wscons_keydesc arckbd_keydesctab
[] = {
216 KBD_MAP(KB_UK
, 0, arckbd_keydesc_uk
),
217 KBD_MAP(KB_NO
, KB_UK
, arckbd_keydesc_no
),
218 KBD_MAP(KB_SV
, KB_NO
, arckbd_keydesc_se
),
219 KBD_MAP(KB_DE
, KB_SV
, arckbd_keydesc_de
),
223 const struct wskbd_mapdata arckbd_mapdata_default
= {
224 arckbd_keydesctab
, KB_UK
227 const struct arckbd_kbidtab arckbd_kbidtab
[] = {
228 { ARCKBD_KBID_UK
, KB_UK
},
229 { ARCKBD_KBID_NO
, KB_NO
},
230 { ARCKBD_KBID_SE
, KB_SV
},
231 { ARCKBD_KBID_DE
, KB_DE
},