No empty .Rs/.Re
[netbsd-mini2440.git] / sys / arch / acorn26 / ioc / arckbdmap.c
bloba43087ce2eb101412de15af989596eb939ad3af1
1 /* $NetBSD: arckbdmap.c,v 1.2.14.3 2004/09/21 13:11:20 skrll Exp $ */
2 /*-
3 * Copyright (c) 1998 Ben Harris
4 * All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
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,
59 KC(0x0b), KS_f11,
60 KC(0x0c), KS_f12,
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,
80 KC(0x1f), KS_Insert,
81 KC(0x20), KS_Home,
82 KC(0x21), KS_Prior,
83 KC(0x22), KS_Num_Lock,
84 KC(0x23), KS_KP_Divide,
85 KC(0x24), KS_KP_Multiply,
86 KC(0x25), KS_KP_Numbersign,
88 KC(0x26), KS_Tab,
89 KC(0x27), KS_q,
90 KC(0x28), KS_w,
91 KC(0x29), KS_e,
92 KC(0x2a), KS_r,
93 KC(0x2b), KS_t,
94 KC(0x2c), KS_y,
95 KC(0x2d), KS_u,
96 KC(0x2e), KS_i,
97 KC(0x2f), KS_o,
98 KC(0x30), KS_p,
99 KC(0x31), KS_bracketleft, KS_braceleft,
100 KC(0x32), KS_bracketright,KS_braceright,
101 KC(0x33), KS_backslash, KS_bar,
102 KC(0x34), KS_Delete,
103 KC(0x35), KS_End, /* really Copy */
104 KC(0x36), KS_Next,
105 KC(0x37), KS_KP_7,
106 KC(0x38), KS_KP_8,
107 KC(0x39), KS_KP_9,
108 KC(0x3a), KS_KP_Subtract,
110 KC(0x3b), KS_Cmd1, KS_Control_L,
111 KC(0x3c), KS_a,
112 KC(0x3d), KS_s,
113 KC(0x3e), KS_d,
114 KC(0x3f), KS_f,
115 KC(0x40), KS_g,
116 KC(0x41), KS_h,
117 KC(0x42), KS_j,
118 KC(0x43), KS_k,
119 KC(0x44), KS_l,
120 KC(0x45), KS_semicolon, KS_colon,
121 KC(0x46), KS_apostrophe, KS_quotedbl,
122 KC(0x47), KS_Return,
123 KC(0x48), KS_KP_4,
124 KC(0x49), KS_KP_5,
125 KC(0x4a), KS_KP_6,
126 KC(0x4b), KS_KP_Add,
128 KC(0x4c), KS_Shift_L,
129 KC(0x4e), KS_z,
130 KC(0x4f), KS_x,
131 KC(0x50), KS_c,
132 KC(0x51), KS_v,
133 KC(0x52), KS_b,
134 KC(0x53), KS_n,
135 KC(0x54), KS_m,
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,
140 KC(0x59), KS_Up,
141 KC(0x5a), KS_KP_1,
142 KC(0x5b), KS_KP_2,
143 KC(0x5c), KS_KP_3,
145 KC(0x5d), KS_Caps_Lock,
146 KC(0x5e), KS_Cmd2, KS_Alt_L,
147 KC(0x5f), KS_space,
148 KC(0x60), KS_Alt_R,
149 KC(0x61), KS_Control_R,
150 KC(0x62), KS_Left,
151 KC(0x63), KS_Down,
152 KC(0x64), KS_Right,
153 KC(0x65), KS_KP_0,
154 KC(0x66), KS_KP_Decimal,
155 KC(0x67), KS_KP_Enter,
157 /* Mouse buttons */
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[] = {
164 /* Based on uk */
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,
175 KC(0x31), KS_aring,
176 KC(0x32), KS_asciicircum, KS_asterisk,
177 KC(0x45), KS_oslash,
178 KC(0x46), KS_ae,
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[] = {
186 /* Based on no */
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[] = {
195 /* Based on se */
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,
204 KC(0x2c), KS_z,
205 KC(0x31), KS_udiaeresis,
206 KC(0x32), KS_plus, KS_asterisk, KS_asciitilde,
207 KC(0x33), KS_numbersign, KS_apostrophe,
208 KC(0x4e), KS_y,
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),
220 {0},
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 },
232 { -1 },