BSD 4_3_Net_2 development
[unix-history] / .ref-BSD-4_3_Reno / usr / src / sys / hpdev / hil_keymaps.c
CommitLineData
60f56dfc
KM
1/*
2 * Copyright (c) 1988 University of Utah.
3 * Copyright (c) 1990 The Regents of the University of California.
4 * All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * the Systems Programming Group of the University of Utah Computer
8 * Science Department.
9 *
1c15e888
C
10 * Redistribution is only permitted until one year after the first shipment
11 * of 4.4BSD by the Regents. Otherwise, redistribution and use in source and
12 * binary forms are permitted provided that: (1) source distributions retain
13 * this entire copyright notice and comment, and (2) distributions including
14 * binaries display the following acknowledgement: This product includes
15 * software developed by the University of California, Berkeley and its
16 * contributors'' in the documentation or other materials provided with the
17 * distribution and in all advertising materials mentioning features or use
18 * of this software. Neither the name of the University nor the names of
19 * its contributors may be used to endorse or promote products derived from
20 * this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
22 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
23 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
60f56dfc 24 *
1c15e888 25 * from: Utah $Hdr: hil_keymaps.c 1.1 89/08/22$
60f56dfc 26 *
1c15e888 27 * @(#)hil_keymaps.c 7.1 (Berkeley) 5/8/90
60f56dfc
KM
28 */
29
30/*
1c15e888
C
31 * Keymaps for various HP-HIL keyboard layouts.
32 * These tables apply only to keyboards in "cooked" mode.
33 * Currently only one is supported as an ITE keyboard.
60f56dfc 34 *
1c15e888
C
35 * Maps are indexed by cooked keycode and contain the ASCII
36 * character for that keycode. The map-set used depends on the
37 * keyboard "language". The map used within that set depends on
38 * the shift/control status that is returned by the hardware along
39 * with the keycode. If an entry is NULL for a key in the appropriate
40 * unshifted, shifted, control, or control-shifted table, then a
41 * single "string" table is consulted. In this fashion, a multi-
42 * character sequence can be returned for a key press. Note that
43 * control/shift status have no effect on multi-character lookup
44 * (i.e. there is only one string table per set, not four).
60f56dfc 45 *
1c15e888
C
46 * Someday we could allow user-definable keymaps, but we would have
47 * to come up with a better format (at least externally). This
48 * format takes up lots of space. Having keymaps for all 18 or so
49 * HP supported layouts would be bad news.
60f56dfc 50 */
1c15e888 51#include "param.h"
60f56dfc
KM
52#include "kbdmap.h"
53
54char us_keymap[] = {
55 NULL, '`', '\\', ESC, NULL, DEL, NULL, NULL,
56 '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
57 NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
58 NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
59 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
60 NULL, NULL, NULL, NULL, NULL, NULL, '\b', NULL,
61 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
62 ESC, '\r', NULL, '\n', '0', '.', ',', '+',
63 '1', '2', '3', '-', '4', '5', '6', '*',
64 '7', '8', '9', '/', 'E', '(', ')', '^',
65 '1', '2', '3', '4', '5', '6', '7', '8',
66 '9', '0', '-', '=', '[', ']', ';', '\'',
67 ',', '.', '/', '\040', 'o', 'p', 'k', 'l',
68 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i',
69 'a', 's', 'd', 'f', 'g', 'h', 'j', 'm',
70 'z', 'x', 'c', 'v', 'b', 'n', NULL, NULL
71};
72
73char us_shiftmap[] = {
74 NULL, '~', '|', DEL, NULL, DEL, NULL, NULL,
75 '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
76 NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
77 NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
78 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
79 NULL, NULL, NULL, NULL, NULL, NULL, DEL, NULL,
80 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
81 ESC, '\r', NULL, '\n', '0', '.', ',', '+',
82 '1', '2', '3', '-', '4', '5', '6', '*',
83 '7', '8', '9', '/', '`', '|', '\\', '~',
84 '!', '@', '#', '$', '%', '^', '&', '*',
85 '(', ')', '_', '+', '{', '}', ':', '\"',
86 '<', '>', '?', '\040', 'O', 'P', 'K', 'L',
87 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I',
88 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'M',
89 'Z', 'X', 'C', 'V', 'B', 'N', NULL, NULL
90};
91
92char us_ctrlmap[] = {
93 NULL, '`', '\034', ESC, NULL, DEL, NULL, NULL,
94 '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
95 NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
96 NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
97 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
98 NULL, NULL, NULL, NULL, NULL, NULL, '\b', NULL,
99 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
100 ESC, '\r', NULL, '\n', '0', '.', ',', '+',
101 '1', '2', '3', '-', '4', '5', '6', '*',
102 '7', '8', '9', '/', 'E', '(', ')', '\036',
103 '1', '2', '3', '4', '5', '6', '7', '8',
104 '9', '0', '-', '=', '\033', '\035', ';', '\'',
105 ',', '.', '/', '\040', '\017', '\020', '\013', '\014',
106 '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
107 '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
108 '\032', '\030', '\003', '\026', '\002', '\016', NULL, NULL
109};
110
111char us_ctrlshiftmap[] = {
112 NULL, '~', '|', DEL, NULL, DEL, NULL, NULL,
113 '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
114 NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
115 NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
116 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
117 NULL, NULL, NULL, NULL, NULL, NULL, DEL, NULL,
118 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
119 ESC, '\r', NULL, '\n', '0', '.', ',', '+',
120 '1', '2', '3', '-', '4', '5', '6', '*',
121 '7', '8', '9', '/', '`', '|', '\034', '~',
122 '!', '\000', '#', '$', '%', '\036', '&', '*',
123 '(', ')', '\037', '+', '{', '}', ':', '\"',
124 '<', '>', '?', '\040', '\017', '\020', '\013', '\014',
125 '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
126 '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
127 '\032', '\030', '\003', '\026', '\002', '\016', NULL, NULL
128};
129
130char *us_stringmap[] = {
131 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
132 NULL, NULL, NULL, NULL, NULL, NULL, "\033V","\033h",
133 "\033U",NULL, NULL, NULL, NULL, NULL, "\033K","\033J",
134 NULL, NULL, NULL, "\033p","\033q","\033t","\033u","\033v",
135 "\033r","\033s","\033B","\033A","\033w",NULL, "\033D","\033C",
136 "\033L","\033M",NULL, NULL, "\033P",NULL, NULL, NULL,
137 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
138 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
139 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
140 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
141 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
142 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
143 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
144 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
145 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
146 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
147};
148
149#ifdef UK_KEYBOARD
150char uk_keymap[] = {
151 NULL, '`', '<', ESC, NULL, DEL, NULL, NULL,
152 '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
153 NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
154 NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
155 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
156 NULL, NULL, NULL, NULL, NULL, NULL, '\b', NULL,
157 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
158 ESC, '\r', NULL, '\n', '0', '.', ',', '+',
159 '1', '2', '3', '-', '4', '5', '6', '*',
160 '7', '8', '9', '/', 'E', '(', ')', '^',
161 '1', '2', '3', '4', '5', '6', '7', '8',
162 '9', '0', '+', '\'', '[', ']', '*', '\\',
163 ',', '.', '-', '\040', 'o', 'p', 'k', 'l',
164 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i',
165 'a', 's', 'd', 'f', 'g', 'h', 'j', 'm',
166 'z', 'x', 'c', 'v', 'b', 'n', NULL, NULL
167};
168
169char uk_shiftmap[] = {
170 NULL, '~', '>', DEL, NULL, DEL, NULL, NULL,
171 '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
172 NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
173 NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
174 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
175 NULL, NULL, NULL, NULL, NULL, NULL, DEL, NULL,
176 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
177 ESC, '\r', NULL, '\n', '0', '.', ',', '+',
178 '1', '2', '3', '-', '4', '5', '6', '*',
179 '7', '8', '9', '/', '`', '|', '\\', '~',
180 '!', '\"', '#', '$', '%', '&', '^', '(',
181 ')', '=', '?', '/', '{', '}', '@', '|',
182 ';', ':', '_', '\040', 'O', 'P', 'K', 'L',
183 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I',
184 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'M',
185 'Z', 'X', 'C', 'V', 'B', 'N', NULL, NULL
186};
187
188char uk_ctrlmap[] = {
189 NULL, '`', '<', ESC, NULL, DEL, NULL, NULL,
190 '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
191 NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
192 NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
193 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
194 NULL, NULL, NULL, NULL, NULL, NULL, '\b', NULL,
195 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
196 ESC, '\r', NULL, '\n', '0', '.', ',', '+',
197 '1', '2', '3', '-', '4', '5', '6', '*',
198 '7', '8', '9', '/', 'E', '(', ')', '\036',
199 '1', '2', '3', '4', '5', '6', '7', '8',
200 '9', '0', '+', '\'', '\033', '\035', '*', '\034',
201 ',', '.', '/', '\040', '\017', '\020', '\013', '\014',
202 '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
203 '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
204 '\032', '\030', '\003', '\026', '\002', '\016', NULL, NULL
205};
206
207char uk_ctrlshiftmap[] = {
208 NULL, '~', '>', DEL, NULL, DEL, NULL, NULL,
209 '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
210 NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
211 NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
212 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
213 NULL, NULL, NULL, NULL, NULL, NULL, DEL, NULL,
214 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
215 ESC, '\r', NULL, '\n', '0', '.', ',', '+',
216 '1', '2', '3', '-', '4', '5', '6', '*',
217 '7', '8', '9', '/', '`', '|', '\034', '~',
218 '!', '\"', '#', '$', '%', '&', '\036', '(',
219 ')', '=', '?', '/', '{', '}', '\000', '|',
220 ';', ':', '\037', '\040', '\017', '\020', '\013', '\014',
221 '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
222 '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
223 '\032', '\030', '\003', '\026', '\002', '\016', NULL, NULL
224};
225#endif
226
227/*
228 * The keyboard map table.
229 * Lookup is by hardware returned language code.
230 */
231struct kbdmap kbd_map[] = {
232 KBD_US, "US ASCII",
233 us_keymap, us_shiftmap, us_ctrlmap, us_ctrlshiftmap,
234 us_stringmap,
235
236#ifdef UK_KEYBOARD
237 KBD_UK, "United Kingdom",
238 uk_keymap, uk_shiftmap, uk_ctrlmap, uk_ctrlshiftmap,
239 us_stringmap,
240#endif
241
242 0, NULL,
243 NULL, NULL, NULL, NULL,
244 NULL,
245};