Sync usage with man page.
[netbsd-mini2440.git] / sys / arch / hp300 / dev / hil_keymaps.c
blob47ff175b4187d6a447dbd0b23e8757da92b89b30
1 /* $NetBSD: hil_keymaps.c,v 1.8.12.4 2005/11/10 13:56:08 skrll Exp $ */
3 /*
4 * Copyright (c) 1990, 1993
5 * The Regents of the University of California. All rights reserved.
7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer
9 * Science Department.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
35 * from: Utah $Hdr: hil_keymaps.c 1.1 90/07/09$
37 * @(#)hil_keymaps.c 8.1 (Berkeley) 6/10/93
40 * Copyright (c) 1988 University of Utah.
42 * This code is derived from software contributed to Berkeley by
43 * the Systems Programming Group of the University of Utah Computer
44 * Science Department.
46 * Redistribution and use in source and binary forms, with or without
47 * modification, are permitted provided that the following conditions
48 * are met:
49 * 1. Redistributions of source code must retain the above copyright
50 * notice, this list of conditions and the following disclaimer.
51 * 2. Redistributions in binary form must reproduce the above copyright
52 * notice, this list of conditions and the following disclaimer in the
53 * documentation and/or other materials provided with the distribution.
54 * 3. All advertising materials mentioning features or use of this software
55 * must display the following acknowledgement:
56 * This product includes software developed by the University of
57 * California, Berkeley and its contributors.
58 * 4. Neither the name of the University nor the names of its contributors
59 * may be used to endorse or promote products derived from this software
60 * without specific prior written permission.
62 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
63 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
64 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
65 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
66 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
67 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
68 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
69 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
70 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
71 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
72 * SUCH DAMAGE.
74 * from: Utah $Hdr: hil_keymaps.c 1.1 90/07/09$
76 * @(#)hil_keymaps.c 8.1 (Berkeley) 6/10/93
80 * Keymaps for various HP-HIL keyboard layouts. These tables apply only to
81 * keyboards in "cooked" mode. Currently only one is supported as an ITE
82 * keyboard.
84 * Maps are indexed by cooked keycode and contain the ASCII character for
85 * that keycode. The map-set used depends on the keyboard "language". The
86 * map used within that set depends on the shift/control status that is
87 * returned by the hardware along with the keycode. If an entry is NUL for
88 * a key in the appropriate unshifted, shifted, control, or control-shifted
89 * table, then a single "string" table is consulted. In this fashion, a
90 * multi- character sequence can be returned for a key press. Note that
91 * control/shift status have no effect on multi-character lookup (i.e. there
92 * is only one string table per set, not four).
94 * Someday we could allow user-definable keymaps, but we would have to come up
95 * with a better format (at least externally). This format takes up lots of
96 * space. Having keymaps for all 18 or so HP supported layouts would be bad
97 * news.
100 #include <sys/cdefs.h>
101 __KERNEL_RCSID(0, "$NetBSD: hil_keymaps.c,v 1.8.12.4 2005/11/10 13:56:08 skrll Exp $");
103 #include <sys/param.h>
104 #include <hp300/dev/kbdmap.h>
106 char us_keymap[] = {
107 '\0', '`', '\\', ESC, '\0', DEL, '\0', '\0',
108 '\n', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
109 '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
110 '\0', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
111 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
112 '\0', '\0', '\0', '\0', '\0', '\0', '\b', '\0',
113 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
114 ESC, '\r', '\0', '\n', '0', '.', ',', '+',
115 '1', '2', '3', '-', '4', '5', '6', '*',
116 '7', '8', '9', '/', 'E', '(', ')', '^',
117 '1', '2', '3', '4', '5', '6', '7', '8',
118 '9', '0', '-', '=', '[', ']', ';', '\'',
119 ',', '.', '/', '\040', 'o', 'p', 'k', 'l',
120 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i',
121 'a', 's', 'd', 'f', 'g', 'h', 'j', 'm',
122 'z', 'x', 'c', 'v', 'b', 'n', '\0', '\0'
125 char us_shiftmap[] = {
126 '\0', '~', '|', DEL, '\0', DEL, '\0', '\0',
127 '\n', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
128 '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
129 '\0', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
130 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
131 '\0', '\0', '\0', '\0', '\0', '\0', DEL, '\0',
132 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
133 ESC, '\r', '\0', '\n', '0', '.', ',', '+',
134 '1', '2', '3', '-', '4', '5', '6', '*',
135 '7', '8', '9', '/', '`', '|', '\\', '~',
136 '!', '@', '#', '$', '%', '^', '&', '*',
137 '(', ')', '_', '+', '{', '}', ':', '\"',
138 '<', '>', '?', '\040', 'O', 'P', 'K', 'L',
139 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I',
140 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'M',
141 'Z', 'X', 'C', 'V', 'B', 'N', '\0', '\0'
144 char us_ctrlmap[] = {
145 '\0', '`', '\034', ESC, '\0', DEL, '\0', '\0',
146 '\n', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
147 '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
148 '\0', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
149 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
150 '\0', '\0', '\0', '\0', '\0', '\0', '\b', '\0',
151 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
152 ESC, '\r', '\0', '\n', '0', '.', ',', '+',
153 '1', '2', '3', '-', '4', '5', '6', '*',
154 '7', '8', '9', '/', 'E', '(', ')', '\036',
155 '1', '2', '3', '4', '5', '6', '7', '8',
156 '9', '0', '-', '=', '\033', '\035', ';', '\'',
157 ',', '.', '/', '\040', '\017', '\020', '\013', '\014',
158 '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
159 '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
160 '\032', '\030', '\003', '\026', '\002', '\016', '\0', '\0'
163 char us_ctrlshiftmap[] = {
164 '\0', '~', '|', DEL, '\0', DEL, '\0', '\0',
165 '\n', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
166 '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
167 '\0', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
168 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
169 '\0', '\0', '\0', '\0', '\0', '\0', DEL, '\0',
170 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
171 ESC, '\r', '\0', '\n', '0', '.', ',', '+',
172 '1', '2', '3', '-', '4', '5', '6', '*',
173 '7', '8', '9', '/', '`', '|', '\034', '~',
174 '!', '\000', '#', '$', '%', '\036', '&', '*',
175 '(', ')', '\037', '+', '{', '}', ':', '\"',
176 '<', '>', '?', '\040', '\017', '\020', '\013', '\014',
177 '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
178 '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
179 '\032', '\030', '\003', '\026', '\002', '\016', '\0', '\0'
182 const char *us_stringmap[] = {
183 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
184 NULL, NULL, NULL, NULL, NULL, NULL, "\033V","\033h",
185 "\033U",NULL, NULL, NULL, NULL, NULL, "\033K","\033J",
186 NULL, NULL, NULL, "\033p","\033q","\033t","\033u","\033v",
187 "\033r","\033s","\033B","\033A","\033w",NULL, "\033D","\033C",
188 "\033L","\033M",NULL, NULL, "\033P",NULL, NULL, NULL,
189 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
190 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
191 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
192 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
193 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
194 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
195 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
196 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
197 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
198 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
201 #ifdef UK_KEYBOARD
202 char uk_keymap[] = {
203 '\0', '`', '<', ESC, '\0', DEL, '\0', '\0',
204 '\n', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
205 '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
206 '\0', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
207 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
208 '\0', '\0', '\0', '\0', '\0', '\0', '\b', '\0',
209 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
210 ESC, '\r', '\0', '\n', '0', '.', ',', '+',
211 '1', '2', '3', '-', '4', '5', '6', '*',
212 '7', '8', '9', '/', 'E', '(', ')', '^',
213 '1', '2', '3', '4', '5', '6', '7', '8',
214 '9', '0', '+', '\'', '[', ']', '*', '\\',
215 ',', '.', '-', '\040', 'o', 'p', 'k', 'l',
216 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i',
217 'a', 's', 'd', 'f', 'g', 'h', 'j', 'm',
218 'z', 'x', 'c', 'v', 'b', 'n', '\0', '\0'
221 char uk_shiftmap[] = {
222 '\0', '~', '>', DEL, '\0', DEL, '\0', '\0',
223 '\n', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
224 '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
225 '\0', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
226 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
227 '\0', '\0', '\0', '\0', '\0', '\0', DEL, '\0',
228 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
229 ESC, '\r', '\0', '\n', '0', '.', ',', '+',
230 '1', '2', '3', '-', '4', '5', '6', '*',
231 '7', '8', '9', '/', '`', '|', '\\', '~',
232 '!', '\"', '#', '$', '%', '&', '^', '(',
233 ')', '=', '?', '/', '{', '}', '@', '|',
234 ';', ':', '_', '\040', 'O', 'P', 'K', 'L',
235 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I',
236 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'M',
237 'Z', 'X', 'C', 'V', 'B', 'N', '\0', '\0'
240 char uk_ctrlmap[] = {
241 '\0', '`', '<', ESC, '\0', DEL, '\0', '\0',
242 '\n', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
243 '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
244 '\0', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
245 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
246 '\0', '\0', '\0', '\0', '\0', '\0', '\b', '\0',
247 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
248 ESC, '\r', '\0', '\n', '0', '.', ',', '+',
249 '1', '2', '3', '-', '4', '5', '6', '*',
250 '7', '8', '9', '/', 'E', '(', ')', '\036',
251 '1', '2', '3', '4', '5', '6', '7', '8',
252 '9', '0', '+', '\'', '\033', '\035', '*', '\034',
253 ',', '.', '/', '\040', '\017', '\020', '\013', '\014',
254 '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
255 '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
256 '\032', '\030', '\003', '\026', '\002', '\016', '\0', '\0'
259 char uk_ctrlshiftmap[] = {
260 '\0', '~', '>', DEL, '\0', DEL, '\0', '\0',
261 '\n', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
262 '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
263 '\0', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
264 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
265 '\0', '\0', '\0', '\0', '\0', '\0', DEL, '\0',
266 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
267 ESC, '\r', '\0', '\n', '0', '.', ',', '+',
268 '1', '2', '3', '-', '4', '5', '6', '*',
269 '7', '8', '9', '/', '`', '|', '\034', '~',
270 '!', '\"', '#', '$', '%', '&', '\036', '(',
271 ')', '=', '?', '/', '{', '}', '\000', '|',
272 ';', ':', '\037', '\040', '\017', '\020', '\013', '\014',
273 '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
274 '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
275 '\032', '\030', '\003', '\026', '\002', '\016', '\0', '\0'
277 #endif
279 #ifdef SE_KEYBOARD
280 char se_keymap[] = {
281 '\0', '<', '\'', ESC, '\0', DEL, '\0', '\0',
282 '\n', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
283 '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
284 '\0', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
285 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
286 '\0', '\0', '\0', '\0', '\0', '\0', '\b', '\0',
287 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
288 ESC, '\r', '\0', '\n', '0', '.', ',', '+',
289 '1', '2', '3', '-', '4', '5', '6', '*',
290 '7', '8', '9', '/', 'E', '(', ')', '^',
291 '1', '2', '3', '4', '5', '6', '7', '8',
292 '9', '0', '+', '`', '}', '~', '|', '{',
293 ',', '.', '-', '\040', 'o', 'p', 'k', 'l',
294 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i',
295 'a', 's', 'd', 'f', 'g', 'h', 'j', 'm',
296 'z', 'x', 'c', 'v', 'b', 'n', '\0', '\0'
299 char se_shiftmap[] = {
300 '\0', '>', '*', DEL, '\0', DEL, '\0', '\0',
301 '\n', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
302 '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
303 '\0', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
304 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
305 '\0', '\0', '\0', '\0', '\0', '\0', DEL, '\0',
306 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
307 ESC, '\r', '\0', '\n', '0', '.', ',', '+',
308 '1', '2', '3', '-', '4', '5', '6', '*',
309 '7', '8', '9', '-', '`', '*', '\\', '>',
310 '!', '\"', '#', '$', '%', '&', '/', '(',
311 ')', '=', '?', '@', ']', '^', '\\', '[',
312 ';', ':', '_', '\040', 'O', 'P', 'K', 'L',
313 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I',
314 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'M',
315 'Z', 'X', 'C', 'V', 'B', 'N', '\0', '\0'
318 char se_ctrlmap[] = {
319 '\0', '`', '\034', ESC, '\0', DEL, '\0', '\0',
320 '\n', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
321 '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
322 '\0', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
323 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
324 '\0', '\0', '\0', '\0', '\0', '\0', '\b', '\0',
325 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
326 ESC, '\r', '\0', '\n', '0', '.', ',', '+',
327 '1', '2', '3', '-', '4', '5', '6', '*',
328 '7', '8', '9', '/', 'E', '(', ')', '\036',
329 '1', '2', '3', '4', '5', '6', '7', '8',
330 '9', '0', '-', '=', '\033', '\035', ';', '\'',
331 ',', '.', '/', '\040', '\017', '\020', '\013', '\014',
332 '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
333 '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
334 '\032', '\030', '\003', '\026', '\002', '\016', '\0', '\0'
337 char se_ctrlshiftmap[] = {
338 '\0', '~', '|', DEL, '\0', DEL, '\0', '\0',
339 '\n', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
340 '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
341 '\0', '\t', '\0', '\0', '\0', '\0', '\0', '\0',
342 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
343 '\0', '\0', '\0', '\0', '\0', '\0', DEL, '\0',
344 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
345 ESC, '\r', '\0', '\n', '0', '.', ',', '+',
346 '1', '2', '3', '-', '4', '5', '6', '*',
347 '7', '8', '9', '/', '`', '|', '\034', '~',
348 '!', '\000', '#', '$', '%', '\036', '&', '*',
349 '(', ')', '\037', '+', '{', '}', ':', '\"',
350 '<', '>', '?', '\040', '\017', '\020', '\013', '\014',
351 '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
352 '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
353 '\032', '\030', '\003', '\026', '\002', '\016', '\0', '\0'
355 #endif
358 * The keyboard map table.
359 * Lookup is by hardware returned language code.
361 struct kbdmap kbd_map[] = {
362 { KBD_US, "US ASCII",
363 us_keymap, us_shiftmap, us_ctrlmap, us_ctrlshiftmap, us_stringmap },
365 #ifdef UK_KEYBOARD
366 { KBD_UK, "United Kingdom",
367 uk_keymap, uk_shiftmap, uk_ctrlmap, uk_ctrlshiftmap, us_stringmap },
368 #endif
370 #ifdef SE_KEYBOARD
371 { KBD_SE, "Swedish",
372 se_keymap, se_shiftmap, se_ctrlmap, se_ctrlshiftmap, us_stringmap },
373 #endif
375 { 0, "", NULL, NULL, NULL, NULL, NULL },