|
|
1.1 root 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: *
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.
18: * 3. All advertising materials mentioning features or use of this software
19: * must display the following acknowledgement:
20: * This product includes software developed by the University of
21: * California, Berkeley and its contributors.
22: * 4. Neither the name of the University nor the names of its contributors
23: * may be used to endorse or promote products derived from this software
24: * without specific prior written permission.
25: *
26: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36: * SUCH DAMAGE.
37: *
38: * from: Utah $Hdr: hil_keymaps.c 1.1 90/07/09$
39: *
1.1.1.2 ! root 40: * from: @(#)hil_keymaps.c 7.3 (Berkeley) 12/16/90
! 41: * hil_keymaps.c,v 1.2 1993/05/22 07:56:16 cgd Exp
1.1 root 42: */
43:
44: /*
45: * Keymaps for various HP-HIL keyboard layouts. These tables apply only to
46: * keyboards in "cooked" mode. Currently only one is supported as an ITE
47: * keyboard.
48: *
49: * Maps are indexed by cooked keycode and contain the ASCII character for
50: * that keycode. The map-set used depends on the keyboard "language". The
51: * map used within that set depends on the shift/control status that is
52: * returned by the hardware along with the keycode. If an entry is NULL for
53: * a key in the appropriate unshifted, shifted, control, or control-shifted
54: * table, then a single "string" table is consulted. In this fashion, a
55: * multi- character sequence can be returned for a key press. Note that
56: * control/shift status have no effect on multi-character lookup (i.e. there
57: * is only one string table per set, not four).
58: *
59: * Someday we could allow user-definable keymaps, but we would have to come up
60: * with a better format (at least externally). This format takes up lots of
61: * space. Having keymaps for all 18 or so HP supported layouts would be bad
62: * news.
63: */
64: #include "sys/param.h"
65: #include "kbdmap.h"
66:
67: char us_keymap[] = {
68: NULL, '`', '\\', ESC, NULL, DEL, NULL, NULL,
69: '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
70: NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
71: NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
72: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
73: NULL, NULL, NULL, NULL, NULL, NULL, '\b', NULL,
74: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
75: ESC, '\r', NULL, '\n', '0', '.', ',', '+',
76: '1', '2', '3', '-', '4', '5', '6', '*',
77: '7', '8', '9', '/', 'E', '(', ')', '^',
78: '1', '2', '3', '4', '5', '6', '7', '8',
79: '9', '0', '-', '=', '[', ']', ';', '\'',
80: ',', '.', '/', '\040', 'o', 'p', 'k', 'l',
81: 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i',
82: 'a', 's', 'd', 'f', 'g', 'h', 'j', 'm',
83: 'z', 'x', 'c', 'v', 'b', 'n', NULL, NULL
84: };
85:
86: char us_shiftmap[] = {
87: NULL, '~', '|', DEL, NULL, DEL, NULL, NULL,
88: '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
89: NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
90: NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
91: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
92: NULL, NULL, NULL, NULL, NULL, NULL, DEL, NULL,
93: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
94: ESC, '\r', NULL, '\n', '0', '.', ',', '+',
95: '1', '2', '3', '-', '4', '5', '6', '*',
96: '7', '8', '9', '/', '`', '|', '\\', '~',
97: '!', '@', '#', '$', '%', '^', '&', '*',
98: '(', ')', '_', '+', '{', '}', ':', '\"',
99: '<', '>', '?', '\040', 'O', 'P', 'K', 'L',
100: 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I',
101: 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'M',
102: 'Z', 'X', 'C', 'V', 'B', 'N', NULL, NULL
103: };
104:
105: char us_ctrlmap[] = {
106: NULL, '`', '\034', ESC, NULL, DEL, NULL, NULL,
107: '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
108: NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
109: NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
110: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
111: NULL, NULL, NULL, NULL, NULL, NULL, '\b', NULL,
112: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
113: ESC, '\r', NULL, '\n', '0', '.', ',', '+',
114: '1', '2', '3', '-', '4', '5', '6', '*',
115: '7', '8', '9', '/', 'E', '(', ')', '\036',
116: '1', '2', '3', '4', '5', '6', '7', '8',
117: '9', '0', '-', '=', '\033', '\035', ';', '\'',
118: ',', '.', '/', '\040', '\017', '\020', '\013', '\014',
119: '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
120: '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
121: '\032', '\030', '\003', '\026', '\002', '\016', NULL, NULL
122: };
123:
124: char us_ctrlshiftmap[] = {
125: NULL, '~', '|', DEL, NULL, DEL, NULL, NULL,
126: '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
127: NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
128: NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
129: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
130: NULL, NULL, NULL, NULL, NULL, NULL, DEL, NULL,
131: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
132: ESC, '\r', NULL, '\n', '0', '.', ',', '+',
133: '1', '2', '3', '-', '4', '5', '6', '*',
134: '7', '8', '9', '/', '`', '|', '\034', '~',
135: '!', '\000', '#', '$', '%', '\036', '&', '*',
136: '(', ')', '\037', '+', '{', '}', ':', '\"',
137: '<', '>', '?', '\040', '\017', '\020', '\013', '\014',
138: '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
139: '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
140: '\032', '\030', '\003', '\026', '\002', '\016', NULL, NULL
141: };
142:
143: char *us_stringmap[] = {
144: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
145: NULL, NULL, NULL, NULL, NULL, NULL, "\033V","\033h",
146: "\033U",NULL, NULL, NULL, NULL, NULL, "\033K","\033J",
147: NULL, NULL, NULL, "\033p","\033q","\033t","\033u","\033v",
148: "\033r","\033s","\033B","\033A","\033w",NULL, "\033D","\033C",
149: "\033L","\033M",NULL, NULL, "\033P",NULL, NULL, NULL,
150: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
151: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
152: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
153: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
154: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
155: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
156: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
157: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
158: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
159: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
160: };
161:
162: #ifdef UK_KEYBOARD
163: char uk_keymap[] = {
164: NULL, '`', '<', ESC, NULL, DEL, NULL, NULL,
165: '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
166: NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
167: NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
168: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
169: NULL, NULL, NULL, NULL, NULL, NULL, '\b', NULL,
170: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
171: ESC, '\r', NULL, '\n', '0', '.', ',', '+',
172: '1', '2', '3', '-', '4', '5', '6', '*',
173: '7', '8', '9', '/', 'E', '(', ')', '^',
174: '1', '2', '3', '4', '5', '6', '7', '8',
175: '9', '0', '+', '\'', '[', ']', '*', '\\',
176: ',', '.', '-', '\040', 'o', 'p', 'k', 'l',
177: 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i',
178: 'a', 's', 'd', 'f', 'g', 'h', 'j', 'm',
179: 'z', 'x', 'c', 'v', 'b', 'n', NULL, NULL
180: };
181:
182: char uk_shiftmap[] = {
183: NULL, '~', '>', DEL, NULL, DEL, NULL, NULL,
184: '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
185: NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
186: NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
187: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
188: NULL, NULL, NULL, NULL, NULL, NULL, DEL, NULL,
189: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
190: ESC, '\r', NULL, '\n', '0', '.', ',', '+',
191: '1', '2', '3', '-', '4', '5', '6', '*',
192: '7', '8', '9', '/', '`', '|', '\\', '~',
193: '!', '\"', '#', '$', '%', '&', '^', '(',
194: ')', '=', '?', '/', '{', '}', '@', '|',
195: ';', ':', '_', '\040', 'O', 'P', 'K', 'L',
196: 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I',
197: 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'M',
198: 'Z', 'X', 'C', 'V', 'B', 'N', NULL, NULL
199: };
200:
201: char uk_ctrlmap[] = {
202: NULL, '`', '<', ESC, NULL, DEL, NULL, NULL,
203: '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
204: NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
205: NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
206: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
207: NULL, NULL, NULL, NULL, NULL, NULL, '\b', NULL,
208: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
209: ESC, '\r', NULL, '\n', '0', '.', ',', '+',
210: '1', '2', '3', '-', '4', '5', '6', '*',
211: '7', '8', '9', '/', 'E', '(', ')', '\036',
212: '1', '2', '3', '4', '5', '6', '7', '8',
213: '9', '0', '+', '\'', '\033', '\035', '*', '\034',
214: ',', '.', '/', '\040', '\017', '\020', '\013', '\014',
215: '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
216: '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
217: '\032', '\030', '\003', '\026', '\002', '\016', NULL, NULL
218: };
219:
220: char uk_ctrlshiftmap[] = {
221: NULL, '~', '>', DEL, NULL, DEL, NULL, NULL,
222: '\n', '\t', NULL, NULL, NULL, NULL, NULL, NULL,
223: NULL, '\n', NULL, NULL, NULL, NULL, NULL, NULL,
224: NULL, '\t', NULL, NULL, NULL, NULL, NULL, NULL,
225: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
226: NULL, NULL, NULL, NULL, NULL, NULL, DEL, NULL,
227: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
228: ESC, '\r', NULL, '\n', '0', '.', ',', '+',
229: '1', '2', '3', '-', '4', '5', '6', '*',
230: '7', '8', '9', '/', '`', '|', '\034', '~',
231: '!', '\"', '#', '$', '%', '&', '\036', '(',
232: ')', '=', '?', '/', '{', '}', '\000', '|',
233: ';', ':', '\037', '\040', '\017', '\020', '\013', '\014',
234: '\021', '\027', '\005', '\022', '\024', '\031', '\025', '\011',
235: '\001', '\023', '\004', '\006', '\007', '\010', '\012', '\015',
236: '\032', '\030', '\003', '\026', '\002', '\016', NULL, NULL
237: };
238: #endif
239:
240: /*
241: * The keyboard map table.
242: * Lookup is by hardware returned language code.
243: */
244: struct kbdmap kbd_map[] = {
245: KBD_US, "US ASCII",
246: us_keymap, us_shiftmap, us_ctrlmap, us_ctrlshiftmap,
247: us_stringmap,
248:
249: #ifdef UK_KEYBOARD
250: KBD_UK, "United Kingdom",
251: uk_keymap, uk_shiftmap, uk_ctrlmap, uk_ctrlshiftmap,
252: us_stringmap,
253: #endif
254:
255: 0, NULL,
256: NULL, NULL, NULL, NULL,
257: NULL,
258: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.