xref: /titanic_44/usr/src/uts/common/io/keytables.c (revision c28749e97052f09388969427adf7df641cdcdc22)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1987-1997,1999 by Sun Microsystems, Inc.
24  *	All rights reserved.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 		/* SunOS-4.0 1.19	*/
29 
30 /*
31  * This module contains the translation tables for the up-down encoded
32  * Sun keyboards.
33  */
34 
35 #include <sys/param.h>
36 #include <sys/kbd.h>
37 
38 /* handy way to define control characters in the tables */
39 #define	c(c_char)	(c_char&0x1F)
40 #define	ESC 0x1B
41 #define	DEL 0x7F
42 
43 
44 /* Unshifted keyboard table for Type 3 keyboard */
45 
46 static struct keymap keytab_s3_lc = {
47 /* BEGIN CSTYLED */
48 /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
49 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	HOLE,
50 /*  8 */	TF(3), 	HOLE,	TF(4),	HOLE,	TF(5),	HOLE,	TF(6),	HOLE,
51 /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
52 						HOLE,	RF(1),	RF(2),	RF(3),
53 /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'1',	'2',
54 /* 32 */	'3',	'4',	'5',	'6',	'7',	'8',	'9',	'0',
55 /* 40 */	'-',	'=',	'`',	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
56 /* 48 */	HOLE,	LF(5),	HOLE,	LF(6),	HOLE,	'\t',	'q',	'w',
57 /* 56 */	'e',	'r',	't',	'y',	'u',	'i',	'o',	'p',
58 /* 64 */	'[',	']',	DEL,	HOLE,	RF(7),	STRING+UPARROW,
59 								RF(9),	HOLE,
60 /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
61 							'a', 	's',	'd',
62 /* 80 */	'f',	'g',	'h',	'j',	'k',	'l',	';',	'\'',
63 /* 88 */	'\\',	'\r',	HOLE,	STRING+LEFTARROW,
64 						RF(11),	STRING+RIGHTARROW,
65 								HOLE,	LF(9),
66 /* 96 */	HOLE,	LF(10),	HOLE,	SHIFTKEYS+LEFTSHIFT,
67 						'z',	'x',	'c',	'v',
68 /*104 */	'b',	'n',	'm',	',',	'.',	'/',	SHIFTKEYS+RIGHTSHIFT,
69 									'\n',
70 /*112 */	RF(13),	STRING+DOWNARROW,
71 				RF(15),	HOLE,	HOLE,	HOLE,	HOLE,	SHIFTKEYS+CAPSLOCK,
72 /*120 */	BUCKYBITS+METABIT,
73 			' ',	BUCKYBITS+METABIT,
74 					HOLE,	HOLE,	HOLE,	ERROR,	IDLE,
75 /* END CSTYLED */
76 };
77 
78 /* Shifted keyboard table for Type 3 keyboard */
79 
80 static struct keymap keytab_s3_uc = {
81 /* BEGIN CSTYLED */
82 /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
83 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	HOLE,
84 /*  8 */	TF(3), 	HOLE,	TF(4),	HOLE,	TF(5),	HOLE,	TF(6),	HOLE,
85 /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
86 						HOLE,	RF(1),	RF(2),	RF(3),
87 /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'!',    '@',
88 /* 32 */	'#',	'$',	'%',	'^',	'&',	'*',	'(',	')',
89 /* 40 */	'_',	'+',	'~',	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
90 /* 48 */	HOLE,	LF(5),	HOLE,	LF(6),	HOLE,	'\t',	'Q',	'W',
91 /* 56 */	'E',	'R',	'T',	'Y',	'U',	'I',	'O',	'P',
92 /* 64 */	'{',	'}',	DEL,	HOLE,	RF(7),	STRING+UPARROW,
93 								RF(9),	HOLE,
94 /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
95 							'A', 	'S',	'D',
96 /* 80 */	'F',	'G',	'H',	'J',	'K',	'L',	':',	'"',
97 /* 88 */	'|',	'\r',	HOLE,	STRING+LEFTARROW,
98 						RF(11),	STRING+RIGHTARROW,
99 								HOLE,	LF(9),
100 /* 96 */	HOLE,	LF(10),	HOLE,	SHIFTKEYS+LEFTSHIFT,
101 						'Z',	'X',	'C',	'V',
102 /*104 */	'B',	'N',	'M',	'<',	'>',	'?',	SHIFTKEYS+RIGHTSHIFT,
103 									'\n',
104 /*112 */	RF(13),	STRING+DOWNARROW,
105 				RF(15),	HOLE,	HOLE,	HOLE,	HOLE,	SHIFTKEYS+CAPSLOCK,
106 /*120 */	BUCKYBITS+METABIT,
107 			' ',	BUCKYBITS+METABIT,
108 					HOLE,	HOLE,	HOLE,	ERROR,	IDLE,
109 /* END CSTYLED */
110 };
111 
112 /* Caps Locked keyboard table for Type 3 keyboard */
113 
114 static struct keymap keytab_s3_cl = {
115 /* BEGIN CSTYLED */
116 /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
117 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	HOLE,
118 /*  8 */	TF(3), 	HOLE,	TF(4),	HOLE,	TF(5),	HOLE,	TF(6),	HOLE,
119 /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
120 						HOLE,	RF(1),	RF(2),	RF(3),
121 /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'1',	'2',
122 /* 32 */	'3',	'4',	'5',	'6',	'7',	'8',	'9',	'0',
123 /* 40 */	'-',	'=',	'`',	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
124 /* 48 */	HOLE,	LF(5),	HOLE,	LF(6),	HOLE,	'\t',	'Q',	'W',
125 /* 56 */	'E',	'R',	'T',	'Y',	'U',	'I',	'O',	'P',
126 /* 64 */	'[',	']',	DEL,	HOLE,	RF(7),	STRING+UPARROW,
127 								RF(9),	HOLE,
128 /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
129 							'A', 	'S',	'D',
130 /* 80 */	'F',	'G',	'H',	'J',	'K',	'L',	';',	'\'',
131 /* 88 */	'\\',	'\r',	HOLE,	STRING+LEFTARROW,
132 						RF(11),	STRING+RIGHTARROW,
133 								HOLE,	LF(9),
134 /* 96 */	HOLE,	LF(10),	HOLE,	SHIFTKEYS+LEFTSHIFT,
135 						'Z',	'X',	'C',	'V',
136 /*104 */	'B',	'N',	'M',	',',	'.',	'/',	SHIFTKEYS+RIGHTSHIFT,
137 									'\n',
138 /*112 */	RF(13),	STRING+DOWNARROW,
139 				RF(15),	HOLE,	HOLE,	HOLE,	HOLE,	SHIFTKEYS+CAPSLOCK,
140 /*120 */	BUCKYBITS+METABIT,
141 			' ',	BUCKYBITS+METABIT,
142 					HOLE,	HOLE,	HOLE,	ERROR,	IDLE,
143 /* END CSTYLED */
144 };
145 
146 /* Controlled keyboard table for Type 3 keyboard */
147 
148 static struct keymap keytab_s3_ct = {
149 /* BEGIN CSTYLED */
150 /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
151 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	HOLE,
152 /*  8 */	TF(3), 	HOLE,	TF(4),	HOLE,	TF(5),	HOLE,	TF(6),	HOLE,
153 /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
154 						HOLE,	RF(1),	RF(2),	RF(3),
155 /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'1',	c('@'),
156 /* 32 */	'3',	'4',	'5',	c('^'),	'7',	'8',	'9',	'0',
157 /* 40 */	c('_'),	'=',	c('^'),	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
158 /* 48 */	HOLE,	LF(5),	HOLE,	LF(6),	HOLE,	'\t',   c('q'),	c('w'),
159 /* 56 */	c('e'),	c('r'),	c('t'),	c('y'),	c('u'),	c('i'),	c('o'),	c('p'),
160 /* 64 */	c('['),	c(']'),	DEL,	HOLE,	RF(7),	STRING+UPARROW,
161 								RF(9),	HOLE,
162 /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
163 							c('a'),	c('s'),	c('d'),
164 /* 80 */	c('f'),	c('g'),	c('h'),	c('j'),	c('k'),	c('l'),	';',	'\'',
165 /* 88 */	c('\\'),
166 			'\r',	HOLE,	STRING+LEFTARROW,
167 						RF(11),	STRING+RIGHTARROW,
168 								HOLE,	LF(9),
169 /* 96 */	HOLE,	LF(10),	HOLE,	SHIFTKEYS+LEFTSHIFT,
170 						c('z'),	c('x'),	c('c'),	c('v'),
171 /*104 */	c('b'),	c('n'),	c('m'),	',',	'.',	c('_'),	SHIFTKEYS+RIGHTSHIFT,
172 									'\n',
173 /*112 */	RF(13),	STRING+DOWNARROW,
174 				RF(15),	HOLE,	HOLE,	HOLE,	HOLE,	SHIFTKEYS+CAPSLOCK,
175 /*120 */	BUCKYBITS+METABIT,
176 			c(' '),	BUCKYBITS+METABIT,
177 					HOLE,	HOLE,	HOLE,	ERROR,	IDLE,
178 /* END CSTYLED */
179 };
180 
181 /* "Key Up" keyboard table for Type 3 keyboard */
182 
183 static struct keymap keytab_s3_up = {
184 /* BEGIN CSTYLED */
185 /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
186 				HOLE,	NOP,	HOLE,	NOP,	NOP,	HOLE,
187 /*  8 */	NOP, 	HOLE, 	NOP,	HOLE,	NOP,	HOLE,	NOP,	HOLE,
188 /* 16 */	NOP, 	NOP, 	NOP,	SHIFTKEYS+ALT,
189 						HOLE,	NOP,	NOP,	NOP,
190 /* 24 */	HOLE, 	NOP, 	NOP,	HOLE,	HOLE,	NOP,	NOP,	NOP,
191 /* 32 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
192 /* 40 */	NOP,	NOP,	NOP,	NOP,	HOLE,	NOP,	NOP,	NOP,
193 /* 48 */	HOLE,	NOP,	HOLE,	NOP,	HOLE,	NOP,	NOP,	NOP,
194 /* 56 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
195 /* 64 */	NOP,	NOP,	NOP,	HOLE,	NOP,	NOP,	NOP,	HOLE,
196 /* 72 */	NOP,	NOP,	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
197 							NOP, 	NOP,	NOP,
198 /* 80 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
199 /* 88 */	NOP,	NOP,	HOLE,	NOP,	NOP,	NOP,	HOLE,	NOP,
200 /* 96 */	HOLE,	NOP,	HOLE,	SHIFTKEYS+LEFTSHIFT,
201 						NOP,	NOP,	NOP,	NOP,
202 /*104 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	SHIFTKEYS+RIGHTSHIFT,
203 									NOP,
204 /*112 */	NOP,	NOP,	NOP,	HOLE,	HOLE,	HOLE,	HOLE,	NOP,
205 /*120 */	BUCKYBITS+METABIT,
206 			NOP,	BUCKYBITS+METABIT,
207 					HOLE,	HOLE,	HOLE,	HOLE,	RESET,
208 /* END CSTYLED */
209 };
210 
211 /* Index to keymaps for Type 3 keyboard */
212 static struct keyboard keyindex_s3 = {
213 	&keytab_s3_lc,
214 	&keytab_s3_uc,
215 	&keytab_s3_cl,
216 	0,		/* no Alt Graph key, no Alt Graph table */
217 	0,		/* no Num Lock key, no Num Lock table */
218 	&keytab_s3_ct,
219 	&keytab_s3_up,
220 	0x0000,		/* Shift bits which stay on with idle keyboard */
221 	0x0000,		/* Bucky bits which stay on with idle keyboard */
222 	1, 0,	77,	/* abort keys */
223 	CAPSMASK,	/* Shift bits which toggle on down event */
224 	NULL,
225 };
226 
227 
228 /* Unshifted keyboard table for Type 4 keyboard */
229 
230 static struct keymap keytab_s4_lc = {
231 /* BEGIN CSTYLED */
232 /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
233 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	TF(10),
234 /*  8 */	TF(3), 	TF(11),	TF(4),	TF(12),	TF(5),	SHIFTKEYS+ALTGRAPH,
235 								TF(6),	HOLE,
236 /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
237 						HOLE,	RF(1),	RF(2),	RF(3),
238 /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'1',	'2',
239 /* 32 */	'3',	'4',	'5',	'6',	'7',	'8',	'9',	'0',
240 /* 40 */	'-',	'=',	'`',	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
241 /* 48 */	BF(13),	LF(5),	BF(10),	LF(6),	HOLE,	'\t',	'q',	'w',
242 /* 56 */	'e',	'r',	't',	'y',	'u',	'i',	'o',	'p',
243 /* 64 */	'[',	']',	DEL,	COMPOSE,
244 						RF(7),	STRING+UPARROW,
245 								RF(9),	BF(15),
246 /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
247 							'a', 	's',	'd',
248 /* 80 */	'f',	'g',	'h',	'j',	'k',	'l',	';',	'\'',
249 /* 88 */	'\\',	'\r',	BF(11),	STRING+LEFTARROW,
250 						RF(11),	STRING+RIGHTARROW,
251 								BF(8),	LF(9),
252 /* 96 */	HOLE,	LF(10),	SHIFTKEYS+NUMLOCK,
253 					SHIFTKEYS+LEFTSHIFT,
254 						'z',	'x',	'c',	'v',
255 /*104 */	'b',	'n',	'm',	',',	'.',	'/',	SHIFTKEYS+RIGHTSHIFT,
256 									'\n',
257 /*112 */	RF(13),	STRING+DOWNARROW,
258 				RF(15),	HOLE,	HOLE,	HOLE,	LF(16),	SHIFTKEYS+CAPSLOCK,
259 /*120 */	BUCKYBITS+METABIT,
260 			' ',	BUCKYBITS+METABIT,
261 					HOLE,	HOLE,	BF(14),	ERROR,	IDLE,
262 /* END CSTYLED */
263 };
264 
265 /* Shifted keyboard table for Type 4 keyboard */
266 
267 static struct keymap keytab_s4_uc = {
268 /* BEGIN CSTYLED */
269 /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
270 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	TF(10),
271 /*  8 */	TF(3), 	TF(11),	TF(4),	TF(12),	TF(5),	SHIFTKEYS+ALTGRAPH,
272 								TF(6),	HOLE,
273 /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
274 						HOLE,	RF(1),	RF(2),	RF(3),
275 /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'!',    '@',
276 /* 32 */	'#',	'$',	'%',	'^',	'&',	'*',	'(',	')',
277 /* 40 */	'_',	'+',	'~',	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
278 /* 48 */	BF(13),	LF(5),	BF(10),	LF(6),	HOLE,	'\t',	'Q',	'W',
279 /* 56 */	'E',	'R',	'T',	'Y',	'U',	'I',	'O',	'P',
280 /* 64 */	'{',	'}',	DEL,	COMPOSE,
281 						RF(7),	STRING+UPARROW,
282 								RF(9),	BF(15),
283 /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
284 							'A', 	'S',	'D',
285 /* 80 */	'F',	'G',	'H',	'J',	'K',	'L',	':',	'"',
286 /* 88 */	'|',	'\r',	BF(11),	STRING+LEFTARROW,
287 						RF(11),	STRING+RIGHTARROW,
288 								BF(8),	LF(9),
289 /* 96 */	HOLE,	LF(10),	SHIFTKEYS+NUMLOCK,
290 					SHIFTKEYS+LEFTSHIFT,
291 						'Z',	'X',	'C',	'V',
292 /*104 */	'B',	'N',	'M',	'<',	'>',	'?',	SHIFTKEYS+RIGHTSHIFT,
293 									'\n',
294 /*112 */	RF(13),	STRING+DOWNARROW,
295 				RF(15),	HOLE,	HOLE,	HOLE,	LF(16),	SHIFTKEYS+CAPSLOCK,
296 /*120 */	BUCKYBITS+METABIT,
297 			' ',	BUCKYBITS+METABIT,
298 					HOLE,	HOLE,	BF(14),	ERROR,	IDLE,
299 /* END CSTYLED */
300 };
301 
302 /* Caps Locked keyboard table for Type 4 keyboard */
303 
304 static struct keymap keytab_s4_cl = {
305 /* BEGIN CSTYLED */
306 /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
307 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	TF(10),
308 /*  8 */	TF(3), 	TF(11),	TF(4),	TF(12),	TF(5),	SHIFTKEYS+ALTGRAPH,
309 								TF(6),	HOLE,
310 /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
311 						HOLE,	RF(1),	RF(2),	RF(3),
312 /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'1',	'2',
313 /* 32 */	'3',	'4',	'5',	'6',	'7',	'8',	'9',	'0',
314 /* 40 */	'-',	'=',	'`',	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
315 /* 48 */	BF(13),	LF(5),	BF(10),	LF(6),	HOLE,	'\t',	'Q',	'W',
316 /* 56 */	'E',	'R',	'T',	'Y',	'U',	'I',	'O',	'P',
317 /* 64 */	'[',	']',	DEL,	COMPOSE,
318 						RF(7),	STRING+UPARROW,
319 								RF(9),	BF(15),
320 /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
321 							'A', 	'S',	'D',
322 /* 80 */	'F',	'G',	'H',	'J',	'K',	'L',	';',	'\'',
323 /* 88 */	'\\',	'\r',	BF(11),	STRING+LEFTARROW,
324 						RF(11),	STRING+RIGHTARROW,
325 								BF(8),	LF(9),
326 /* 96 */	HOLE,	LF(10),	SHIFTKEYS+NUMLOCK,
327 					SHIFTKEYS+LEFTSHIFT,
328 						'Z',	'X',	'C',	'V',
329 /*104 */	'B',	'N',	'M',	',',	'.',	'/',	SHIFTKEYS+RIGHTSHIFT,
330 									'\n',
331 /*112 */	RF(13),	STRING+DOWNARROW,
332 				RF(15),	HOLE,	HOLE,	HOLE,	LF(16),	SHIFTKEYS+CAPSLOCK,
333 /*120 */	BUCKYBITS+METABIT,
334 			' ',	BUCKYBITS+METABIT,
335 					HOLE,	HOLE,	BF(14),	ERROR,	IDLE,
336 /* END CSTYLED */
337 };
338 
339 /* Alt Graph keyboard table for Type 4 keyboard */
340 
341 static struct keymap keytab_s4_ag = {
342 /* BEGIN CSTYLED */
343 /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
344 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	TF(10),
345 /*  8 */	TF(3), 	TF(11),	TF(4),	TF(12),	TF(5),	SHIFTKEYS+ALTGRAPH,
346 								TF(6),	HOLE,
347 /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
348 						HOLE,	RF(1),	RF(2),	RF(3),
349 /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	NOP,	NOP,
350 /* 32 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
351 /* 40 */	NOP,	NOP,	NOP,	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
352 /* 48 */	BF(13),	LF(5),	BF(10),	LF(6),	HOLE,	'\t',	NOP,	NOP,
353 /* 56 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
354 /* 64 */	NOP,	NOP,	DEL,	COMPOSE,
355 						RF(7),	STRING+UPARROW,
356 								RF(9),	BF(15),
357 /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
358 							NOP, 	NOP,	NOP,
359 /* 80 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
360 /* 88 */	NOP,	'\r',	BF(11),	STRING+LEFTARROW,
361 						RF(11),	STRING+RIGHTARROW,
362 								BF(8),	LF(9),
363 /* 96 */	HOLE,	LF(10),	SHIFTKEYS+NUMLOCK,
364 					SHIFTKEYS+LEFTSHIFT,
365 						NOP,	NOP,	NOP,	NOP,
366 /*104 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	SHIFTKEYS+RIGHTSHIFT,
367 									'\n',
368 /*112 */	RF(13),	STRING+DOWNARROW,
369 				RF(15),	HOLE,	HOLE,	HOLE,	LF(16),	SHIFTKEYS+CAPSLOCK,
370 /*120 */	BUCKYBITS+METABIT,
371 			' ',	BUCKYBITS+METABIT,
372 					HOLE,	HOLE,	BF(14),	ERROR,	IDLE,
373 /* END CSTYLED */
374 };
375 
376 /* Num Locked keyboard table for Type 4 keyboard */
377 
378 static struct keymap keytab_s4_nl = {
379 /* BEGIN CSTYLED */
380 /*  0 */	HOLE,	NONL,	HOLE,	NONL,	HOLE,	NONL,	NONL,	NONL,
381 /*  8 */	NONL, 	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	HOLE,
382 /* 16 */	NONL,	NONL,	NONL,	NONL,	HOLE,	NONL,	NONL,	NONL,
383 /* 24 */	HOLE, 	NONL, 	NONL,	HOLE,	HOLE,	NONL,	NONL,	NONL,
384 /* 32 */	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,
385 /* 40 */	NONL,	NONL,	NONL,	NONL,	HOLE,	PADEQUAL,
386 								PADSLASH,
387 									PADSTAR,
388 /* 48 */	NONL,	NONL,	PADDOT,	NONL,	HOLE,	NONL,	NONL,	NONL,
389 /* 56 */	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,
390 /* 64 */	NONL,	NONL,	NONL,	NONL,
391 						PAD7,	PAD8,	PAD9,	PADMINUS,
392 /* 72 */	NONL,	NONL,	HOLE,	HOLE,	NONL,	NONL, 	NONL,	NONL,
393 /* 80 */	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,
394 /* 88 */	NONL,	NONL,	PADENTER,
395 					PAD4,	PAD5,	PAD6,	PAD0,	NONL,
396 /* 96 */	HOLE,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,
397 /*104 */	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,
398 									NONL,
399 /*112 */	PAD1,	PAD2,	PAD3,	HOLE,	HOLE,	HOLE,	NONL,	NONL,
400 /*120 */	NONL,	NONL,	NONL,	HOLE,	HOLE,	PADPLUS,
401 								ERROR,	IDLE,
402 /* END CSTYLED */
403 };
404 
405 /* Controlled keyboard table for Type 4 keyboard */
406 
407 static struct keymap keytab_s4_ct = {
408 /* BEGIN CSTYLED */
409 /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
410 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	TF(10),
411 /*  8 */	TF(3), 	TF(11),	TF(4),	TF(12),	TF(5),	SHIFTKEYS+ALTGRAPH,
412 								TF(6),	HOLE,
413 /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
414 						HOLE,	RF(1),	RF(2),	RF(3),
415 /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'1',	c('@'),
416 /* 32 */	'3',	'4',	'5',	c('^'),	'7',	'8',	'9',	'0',
417 /* 40 */	c('_'),	'=',	c('^'),	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
418 /* 48 */	BF(13),	LF(5),	BF(10),	LF(6),	HOLE,	'\t',   c('q'),	c('w'),
419 /* 56 */	c('e'),	c('r'),	c('t'),	c('y'),	c('u'),	c('i'),	c('o'),	c('p'),
420 /* 64 */	c('['),	c(']'),	DEL,	COMPOSE,
421 						RF(7),	STRING+UPARROW,
422 								RF(9),	BF(15),
423 /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
424 							c('a'),	c('s'),	c('d'),
425 /* 80 */	c('f'),	c('g'),	c('h'),	c('j'),	c('k'),	c('l'),	';',	'\'',
426 /* 88 */	c('\\'),
427 			'\r',	BF(11),	STRING+LEFTARROW,
428 						RF(11),	STRING+RIGHTARROW,
429 								BF(8),	LF(9),
430 /* 96 */	HOLE,	LF(10),	SHIFTKEYS+NUMLOCK,
431 					SHIFTKEYS+LEFTSHIFT,
432 						c('z'),	c('x'),	c('c'),	c('v'),
433 /*104 */	c('b'),	c('n'),	c('m'),	',',	'.',	c('_'),	SHIFTKEYS+RIGHTSHIFT,
434 									'\n',
435 /*112 */	RF(13),	STRING+DOWNARROW,
436 				RF(15),	HOLE,	HOLE,	HOLE,	LF(16),	SHIFTKEYS+CAPSLOCK,
437 /*120 */	BUCKYBITS+METABIT,
438 			c(' '),	BUCKYBITS+METABIT,
439 					HOLE,	HOLE,	BF(14),	ERROR,	IDLE,
440 /* END CSTYLED */
441 };
442 
443 /* "Key Up" keyboard table for Type 4 keyboard */
444 
445 static struct keymap keytab_s4_up = {
446 /* BEGIN CSTYLED */
447 /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
448 				HOLE,	NOP,	HOLE,	NOP,	NOP,	NOP,
449 /*  8 */	NOP, 	NOP, 	NOP,	NOP,	NOP,	SHIFTKEYS+ALTGRAPH,
450 								NOP,	HOLE,
451 /* 16 */	NOP, 	NOP, 	NOP,	SHIFTKEYS+ALT,
452 						HOLE,	NOP,	NOP,	NOP,
453 /* 24 */	HOLE, 	NOP, 	NOP,	HOLE,	HOLE,	NOP,	NOP,	NOP,
454 /* 32 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
455 /* 40 */	NOP,	NOP,	NOP,	NOP,	HOLE,	NOP,	NOP,	NOP,
456 /* 48 */	NOP,	NOP,	NOP,	NOP,	HOLE,	NOP,	NOP,	NOP,
457 /* 56 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
458 /* 64 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
459 /* 72 */	NOP,	NOP,	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
460 							NOP, 	NOP,	NOP,
461 /* 80 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
462 /* 88 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
463 /* 96 */	HOLE,	NOP,	NOP,
464 					SHIFTKEYS+LEFTSHIFT,
465 						NOP,	NOP,	NOP,	NOP,
466 /*104 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	SHIFTKEYS+RIGHTSHIFT,
467 									NOP,
468 /*112 */	NOP,	NOP,	NOP,	HOLE,	HOLE,	HOLE,	NOP,	NOP,
469 /*120 */	BUCKYBITS+METABIT,
470 			NOP,	BUCKYBITS+METABIT,
471 					HOLE,	HOLE,	NOP,	HOLE,	RESET,
472 /* END CSTYLED */
473 };
474 
475 /* Index to keymaps for Type 4 keyboard */
476 static struct keyboard keyindex_s4 = {
477 	&keytab_s4_lc,
478 	&keytab_s4_uc,
479 	&keytab_s4_cl,
480 	&keytab_s4_ag,
481 	&keytab_s4_nl,
482 	&keytab_s4_ct,
483 	&keytab_s4_up,
484 	0x0000,		/* Shift bits which stay on with idle keyboard */
485 	0x0000,		/* Bucky bits which stay on with idle keyboard */
486 	1, 0,	77,	/* abort keys */
487 	CAPSMASK|NUMLOCKMASK,	/* Shift bits which toggle on down event */
488 	NULL,
489 };
490 
491 
492 /*
493  * Index table for the whole shebang
494  * The first entry is used as the default if the id isn't recognized.
495  */
496 struct keyboards keytables[] = {
497 	KB_SUN3,	&keyindex_s3,
498 	KB_SUN4,	&keyindex_s4,
499 	0,		NULL,
500 };
501 
502 /*
503  * Keyboard String Table
504  *
505  * This defines the strings sent by various keys (as selected in the
506  * tables above).
507  * The first byte of each string is its length, the rest is data.
508  */
509 
510 #ifdef	__STDC__
511 /*
512  * XXX	This is here to silence compiler warnings. The non-ansi-c form
513  *	is retained if somebody can figure out how to replicate it in
514  *	ansi-c.
515  */
516 char keystringtab[16][KTAB_STRLEN] = {
517 	{ '\033', '[', 'H', '\0' },	/* home */
518 	{ '\033', '[', 'A', '\0' },	/* up */
519 	{ '\033', '[', 'B', '\0' },	/* down */
520 	{ '\033', '[', 'D', '\0' },	/* left */
521 	{ '\033', '[', 'C', '\0' },	/* right */
522 };
523 #else	/* __STDC__ */
524 #define	kstescinit(c)	{'\033', '[', 'c', '\0'}
525 char keystringtab[16][KTAB_STRLEN] = {
526 	kstescinit(H) /* home */,
527 	kstescinit(A) /* up */,
528 	kstescinit(B) /* down */,
529 	kstescinit(D) /* left */,
530 	kstescinit(C) /* right */,
531 };
532 #endif	/* __STDC__ */
533 
534 
535 /*
536  * Compose Key Sequence Table
537  *
538  * Taken from Suncompose.h of openwindows.
539  *
540  * The idea here is to create a simple index into a table of
541  * compose key sequences.  The purpose is to provide a fast
542  * lookup mechanism using as little space as possible (while
543  * still using a table of triplets).
544  *
545  * For reference, here is the set of all composable characters:
546  * SP !\"\'*+,-./01234:<>?ACDEHILNOPRSTUXY\\^_`acdehilnoprstuxy|~
547  *
548  * if ascii_char[i] is not composable,
549  *	kb_compose_map[i] is -1
550  * else
551  * 	if ascii_char[i] appears as a first char in compose_table,
552  *		kb_compose_map[i] is the index of it's first appearance
553  *	else
554  *		kb_compose_map[i] is 112	(end of table)
555  */
556 
557 signed char kb_compose_map[ASCII_SET_SIZE] = {
558 /* BEGIN CSTYLED */
559 	 -1,	/* 000 (^@) */
560 	 -1,	/* 001 (^A) */
561 	 -1,	/* 002 (^B) */
562 	 -1,	/* 003 (^C) */
563 	 -1,	/* 004 (^D) */
564 	 -1,	/* 005 (^E) */
565 	 -1,	/* 006 (^F) */
566 	 -1,	/* 007 (^G) */
567 	 -1,	/* 008 (^H) */
568 	 -1,	/* 009 (^I) */
569 	 -1,	/* 010 (^J) */
570 	 -1,	/* 011 (^K) */
571 	 -1,	/* 012 (^L) */
572 	 -1,	/* 013 (^M) */
573 	 -1,	/* 014 (^N) */
574 	 -1,	/* 015 (^O) */
575 	 -1,	/* 016 (^P) */
576 	 -1,	/* 017 (^Q) */
577 	 -1,	/* 018 (^R) */
578 	 -1,	/* 019 (^S) */
579 	 -1,	/* 020 (^T) */
580 	 -1,	/* 021 (^U) */
581 	 -1,	/* 022 (^V) */
582 	 -1,	/* 023 (^W) */
583 	 -1,	/* 024 (^X) */
584 	 -1,	/* 025 (^Y) */
585 	 -1,	/* 026 (^Z) */
586 	 -1,	/* 027 (^[) */
587 	 -1,	/* 028 (^\) */
588 	 -1,	/* 029 (^]) */
589 	 -1,	/* 030 (^^) */
590 	 -1,	/* 031 (^_) */
591 	  0,	/* 032 (SP) */
592 	  1,	/* 033 (!) */
593 	  4,	/* 034 (") */
594 	 -1,	/* 035 (#) */
595 	 -1,	/* 036 ($) */
596 	 -1,	/* 037 (%) */
597 	 -1,	/* 038 (&) */
598 	 16,	/* 039 (') */
599 	 -1,	/* 040 (() */
600 	 -1,	/* 041 ()) */
601 	 28,	/* 042 (*) */
602 	 31,	/* 043 (+) */
603 	 32,	/* 044 (,) */
604 	 36,	/* 045 (-) */
605 	 48,	/* 046 (.) */
606 	 49,	/* 047 (/) */
607 	 54,	/* 048 (0) */
608 	 57,	/* 049 (1) */
609 	 60,	/* 050 (2) */
610 	 61,	/* 051 (3) */
611 	112,	/* 052 (4) */
612 	 -1,	/* 053 (5) */
613 	 -1,	/* 054 (6) */
614 	 -1,	/* 055 (7) */
615 	 -1,	/* 056 (8) */
616 	 -1,	/* 057 (9) */
617 	112,	/* 058 (:) */
618 	 -1,	/* 059 (;) */
619 	 63,	/* 060 (<) */
620 	 -1,	/* 061 (=) */
621 	 64,	/* 062 (>) */
622 	 65,	/* 063 (?) */
623 	 -1,	/* 064 (@) */
624 	 66,	/* 065 (A) */
625 	 -1,	/* 066 (B) */
626 	 70,	/* 067 (C) */
627 	112,	/* 068 (D) */
628 	 71,	/* 069 (E) */
629 	 -1,	/* 070 (F) */
630 	 -1,	/* 071 (G) */
631 	 73,	/* 072 (H) */
632 	 74,	/* 073 (I) */
633 	 -1,	/* 074 (J) */
634 	 -1,	/* 075 (K) */
635 	112,	/* 076 (L) */
636 	 -1,	/* 077 (M) */
637 	 76,	/* 078 (N) */
638 	 77,	/* 079 (O) */
639 	 84,	/* 080 (P) */
640 	 -1,	/* 081 (Q) */
641 	112,	/* 082 (R) */
642 	112,	/* 083 (S) */
643 	112,	/* 084 (T) */
644 	 85,	/* 085 (U) */
645 	 -1,	/* 086 (V) */
646 	 -1,	/* 087 (W) */
647 	112,	/* 088 (X) */
648 	112,	/* 089 (Y) */
649 	 -1,	/* 090 (Z) */
650 	 -1,	/* 091 ([) */
651 	 87,	/* 092 (\) */
652 	 -1,	/* 093 (]) */
653 	 88,	/* 094 (^) */
654 	 93,	/* 095 (_) */
655 	 94,	/* 096 (`) */
656 	 99,	/* 097 (a) */
657 	 -1,	/* 098 (b) */
658 	101,	/* 099 (c) */
659 	112,	/* 100 (d) */
660 	112,	/* 101 (e) */
661 	 -1,	/* 102 (f) */
662 	 -1,	/* 103 (g) */
663 	102,	/* 104 (h) */
664 	112,	/* 105 (i) */
665 	 -1,	/* 106 (j) */
666 	 -1,	/* 107 (k) */
667 	112,	/* 108 (l) */
668 	 -1,	/* 109 (m) */
669 	103,	/* 110 (n) */
670 	104,	/* 111 (o) */
671 	108,	/* 112 (p) */
672 	 -1,	/* 113 (q) */
673 	112,	/* 114 (r) */
674 	109,	/* 115 (s) */
675 	112,	/* 116 (t) */
676 	112,	/* 117 (u) */
677 	 -1,	/* 118 (v) */
678 	 -1,	/* 119 (w) */
679 	110,	/* 120 (x) */
680 	112,	/* 121 (y) */
681 	 -1,	/* 122 (z) */
682 	 -1,	/* 123 ({) */
683 	111,	/* 124 (|) */
684 	 -1,	/* 125 (}) */
685 	112,	/* 126 (~) */
686 	 -1,	/* 127 (DEL) */
687 /* END CSTYLED */
688 };
689 
690 /*
691  * IMPORTANT NOTE:  This table MUST be kept in proper sorted order:
692  * 	The first and second characters in each entry must be in ASCII
693  *	    collating sequence (left to right).
694  *	The table must be in ASCII collating sequence by first character
695  *	    (top to bottom).
696  */
697 
698 /* COMPOSE + first character + second character => ISO character */
699 
700 struct compose_sequence_t kb_compose_table[] = {
701 
702 /* BEGIN CSTYLED */
703 	{' ', ' ', 0xA0},	/* 000 */	/* NBSP (non-breaking space) */
704 	{'!', '!', 0xA1},	/* 001 */	/* inverted ! */
705 	{'!', 'P', 0xB6},	/* 002 */	/* paragraph mark */
706 	{'!', 'p', 0xB6},	/* 003 */	/* paragraph mark */
707 	{'"', '"', 0xA8},	/* 004 */	/* diaresis */
708 	{'"', 'A', 0xC4},	/* 005 */	/* A with diaresis */
709 	{'"', 'E', 0xCB},	/* 006 */	/* E with diaresis */
710 	{'"', 'I', 0xCF},	/* 007 */	/* I with diaresis */
711 	{'"', 'O', 0xD6},	/* 008 */	/* O with diaresis */
712 	{'"', 'U', 0xDC},	/* 009 */	/* U with diaresis */
713 	{'"', 'a', 0xE4},	/* 010 */	/* a with diaresis */
714 	{'"', 'e', 0xEB},	/* 011 */	/* e with diaresis */
715 	{'"', 'i', 0xEF},	/* 012 */	/* i with diaresis */
716 	{'"', 'o', 0xF6},	/* 013 */	/* o with diaresis */
717 	{'"', 'u', 0xFC},	/* 014 */	/* u with diaresis */
718 	{'"', 'y', 0xFF},	/* 015 */	/* y with diaresis */
719 	{'\'','A', 0xC1},	/* 016 */	/* A with acute accent */
720 	{'\'','E', 0xC9},	/* 017 */	/* E with acute accent */
721 	{'\'','I', 0xCD},	/* 018 */	/* I with acute accent */
722 	{'\'','O', 0xD3},	/* 019 */	/* O with acute accent */
723 	{'\'','U', 0xDA},	/* 020 */	/* U with acute accent */
724 	{'\'','Y', 0xDD},	/* 021 */	/* Y with acute accent */
725 	{'\'','a', 0xE1},	/* 022 */	/* a with acute accent */
726 	{'\'','e', 0xE9},	/* 023 */	/* e with acute accent */
727 	{'\'','i', 0xED},	/* 024 */	/* i with acute accent */
728 	{'\'','o', 0xF3},	/* 025 */	/* o with acute accent */
729 	{'\'','u', 0xFA},	/* 026 */	/* u with acute accent */
730 	{'\'','y', 0xFD},	/* 027 */	/* y with acute accent */
731 	{'*', 'A', 0xC5},	/* 028 */	/* A with ring */
732 	{'*', '^', 0xB0},	/* 029 */	/* degree */
733 	{'*', 'a', 0xE5},	/* 030 */	/* a with ring */
734 	{'+', '-', 0xB1},	/* 031 */	/* plus/minus */
735 	{',', ',', 0xB8},	/* 032 */	/* cedilla */
736 	{',', '-', 0xAC},	/* 033 */	/* not sign */
737 	{',', 'C', 0xC7},	/* 034 */	/* C with cedilla */
738 	{',', 'c', 0xE7},	/* 035 */	/* c with cedilla */
739 	{'-', '-', 0xAD},	/* 036 */	/* soft hyphen */
740 	{'-', ':', 0xF7},	/* 037 */	/* division sign */
741 	{'-', 'A', 0xAA},	/* 038 */	/* feminine superior numeral */
742 	{'-', 'D', 0xD0},	/* 039 */	/* Upper-case eth */
743 	{'-', 'L', 0xA3},	/* 040 */	/* pounds sterling */
744 	{'-', 'Y', 0xA5},	/* 041 */	/* yen */
745 	{'-', '^', 0xAF},	/* 042 */	/* macron */
746 	{'-', 'a', 0xAA},	/* 043 */	/* feminine superior numeral */
747 	{'-', 'd', 0xF0},	/* 044 */	/* Lower-case eth */
748 	{'-', 'l', 0xA3},	/* 045 */	/* pounds sterling */
749 	{'-', 'y', 0xA5},	/* 046 */	/* yen */
750 	{'-', '|', 0xAC},	/* 047 */	/* not sign */
751 	{'.', '^', 0xB7},	/* 048 */	/* centered dot */
752 	{'/', 'C', 0xA2},	/* 049 */	/* cent sign */
753 	{'/', 'O', 0xD8},	/* 050 */	/* O with slash */
754 	{'/', 'c', 0xA2},	/* 051 */	/* cent sign */
755 	{'/', 'o', 0xF8},	/* 052 */	/* o with slash */
756 	{'/', 'u', 0xB5},	/* 053 */	/* mu */
757 	{'0', 'X', 0xA4},	/* 054 */	/* currency symbol */
758 	{'0', '^', 0xB0},	/* 055 */	/* degree */
759 	{'0', 'x', 0xA4},	/* 056 */	/* currency symbol */
760 	{'1', '2', 0xBD},	/* 057 */	/* 1/2 */
761 	{'1', '4', 0xBC},	/* 058 */	/* 1/4 */
762 	{'1', '^', 0xB9},	/* 059 */	/* superior '1' */
763 	{'2', '^', 0xB2},	/* 060 */	/* superior '2' */
764 	{'3', '4', 0xBE},	/* 061 */	/* 3/4 */
765 	{'3', '^', 0xB3},	/* 062 */	/* superior '3' */
766 	{'<', '<', 0xAB},	/* 063 */	/* left guillemot */
767 	{'>', '>', 0xBB},	/* 064 */	/* right guillemot */
768 	{'?', '?', 0xBF},	/* 065 */	/* inverted ? */
769 	{'A', 'E', 0xC6},	/* 066 */	/* AE dipthong */
770 	{'A', '^', 0xC2},	/* 067 */	/* A with circumflex accent */
771 	{'A', '`', 0xC0},	/* 068 */	/* A with grave accent */
772 	{'A', '~', 0xC3},	/* 069 */	/* A with tilde */
773 	{'C', 'O', 0xA9},	/* 060 */	/* copyright */
774 	{'E', '^', 0xCA},	/* 071 */	/* E with circumflex accent */
775 	{'E', '`', 0xC8},	/* 072 */	/* E with grave accent */
776 	{'H', 'T', 0xDE},	/* 073 */	/* Upper-case thorn */
777 	{'I', '^', 0xCE},	/* 074 */	/* I with circumflex accent */
778 	{'I', '`', 0xCC},	/* 075 */	/* I with grave accent */
779 	{'N', '~', 0xD1},	/* 076 */	/* N with tilde */
780 	{'O', 'R', 0xAE},	/* 077 */	/* registered */
781 	{'O', 'S', 0xA7},	/* 078 */	/* section mark */
782 	{'O', 'X', 0xA4},	/* 079 */	/* currency symbol */
783 	{'O', '^', 0xD4},	/* 080 */	/* O with circumflex accent */
784 	{'O', '_', 0xBA},	/* 081 */	/* masculine superior numeral */
785 	{'O', '`', 0xD2},	/* 082 */	/* O with grave accent */
786 	{'O', '~', 0xD5},	/* 083 */	/* O with tilde */
787 	{'P', '|', 0xDE},	/* 084 */	/* Upper-case thorn */
788 	{'U', '^', 0xDB},	/* 085 */	/* U with circumflex accent */
789 	{'U', '`', 0xD9},	/* 086 */	/* U with grave accent */
790 	{'\\','\\',0xB4},	/* 087 */	/* acute accent */
791 	{'^', 'a', 0xE2},	/* 088 */	/* a with circumflex accent */
792 	{'^', 'e', 0xEA},	/* 089 */	/* e with circumflex accent */
793 	{'^', 'i', 0xEE},	/* 090 */	/* i with circumflex accent */
794 	{'^', 'o', 0xF4},	/* 091 */	/* o with circumflex accent */
795 	{'^', 'u', 0xFB},	/* 092 */	/* u with circumflex accent */
796 	{'_', 'o', 0xBA},	/* 093 */	/* masculine superior numeral */
797 	{'`', 'a', 0xE0},	/* 094 */	/* a with grave accent */
798 	{'`', 'e', 0xE8},	/* 095 */	/* e with grave accent */
799 	{'`', 'i', 0xEC},	/* 096 */	/* i with grave accent */
800 	{'`', 'o', 0xF2},	/* 097 */	/* o with grave accent */
801 	{'`', 'u', 0xF9},	/* 098 */	/* u with grave accent */
802 	{'a', 'e', 0xE6},	/* 099 */	/* ae dipthong */
803 	{'a', '~', 0xE3},	/* 100 */	/* a with tilde */
804 	{'c', 'o', 0xA9},	/* 101 */	/* copyright */
805 	{'h', 't', 0xFE},	/* 102 */	/* Lower-case thorn */
806 	{'n', '~', 0xF1},	/* 103 */	/* n with tilde */
807 	{'o', 'r', 0xAE},	/* 104 */	/* registered */
808 	{'o', 's', 0xA7},	/* 105 */	/* section mark */
809 	{'o', 'x', 0xA4},	/* 106 */	/* currency symbol */
810 	{'o', '~', 0xF5},	/* 107 */	/* o with tilde */
811 	{'p', '|', 0xFE},	/* 108 */	/* Lower-case thorn */
812 	{'s', 's', 0xDF},	/* 109 */	/* German double-s */
813 	{'x', 'x', 0xD7},	/* 110 */	/* multiplication sign */
814 	{'|', '|', 0xA6},	/* 111 */	/* broken bar */
815 
816 	{0, 0, 0},			/* end of table */
817 };
818 /* END CSTYLED */
819 
820 /*
821  * Floating Accent Sequence Table
822  */
823 
824 /* FA + ASCII character => ISO character */
825 struct fltaccent_sequence_t kb_fltaccent_table[] = {
826 
827 	{FA_UMLAUT, 'A', 0xC4},		/* A with umlaut */
828 	{FA_UMLAUT, 'E', 0xCB},		/* E with umlaut */
829 	{FA_UMLAUT, 'I', 0xCF},		/* I with umlaut */
830 	{FA_UMLAUT, 'O', 0xD6},		/* O with umlaut */
831 	{FA_UMLAUT, 'U', 0xDC},		/* U with umlaut */
832 	{FA_UMLAUT, 'a', 0xE4},		/* a with umlaut */
833 	{FA_UMLAUT, 'e', 0xEB},		/* e with umlaut */
834 	{FA_UMLAUT, 'i', 0xEF},		/* i with umlaut */
835 	{FA_UMLAUT, 'o', 0xF6},		/* o with umlaut */
836 	{FA_UMLAUT, 'u', 0xFC},		/* u with umlaut */
837 	{FA_UMLAUT, 'y', 0xFC},		/* y with umlaut */
838 
839 	{FA_CFLEX, 'A', 0xC2},		/* A with circumflex */
840 	{FA_CFLEX, 'E', 0xCA},		/* E with circumflex */
841 	{FA_CFLEX, 'I', 0xCE},		/* I with circumflex */
842 	{FA_CFLEX, 'O', 0xD4},		/* O with circumflex */
843 	{FA_CFLEX, 'U', 0xDB},		/* U with circumflex */
844 	{FA_CFLEX, 'a', 0xE2},		/* a with circumflex */
845 	{FA_CFLEX, 'e', 0xEA},		/* e with circumflex */
846 	{FA_CFLEX, 'i', 0xEE},		/* i with circumflex */
847 	{FA_CFLEX, 'o', 0xF4},		/* o with circumflex */
848 	{FA_CFLEX, 'u', 0xFB},		/* u with circumflex */
849 
850 	{FA_TILDE, 'A', 0xC3},		/* A with tilde */
851 	{FA_TILDE, 'N', 0xD1},		/* N with tilde */
852 	{FA_TILDE, 'O', 0xD5},		/* O with tilde */
853 	{FA_TILDE, 'a', 0xE3},		/* a with tilde */
854 	{FA_TILDE, 'n', 0xF1},		/* n with tilde */
855 	{FA_TILDE, 'o', 0xF5},		/* o with tilde */
856 
857 	{FA_CEDILLA, 'C', 0xC7},	/* C with cedilla */
858 	{FA_CEDILLA, 'c', 0xE7},	/* c with cedilla */
859 
860 	{FA_ACUTE, 'A', 0xC1},		/* A with acute accent */
861 	{FA_ACUTE, 'E', 0xC9},		/* E with acute accent */
862 	{FA_ACUTE, 'I', 0xCD},		/* I with acute accent */
863 	{FA_ACUTE, 'O', 0xD3},		/* O with acute accent */
864 	{FA_ACUTE, 'U', 0xDA},		/* U with acute accent */
865 	{FA_ACUTE, 'a', 0xE1},		/* a with acute accent */
866 	{FA_ACUTE, 'e', 0xE9},		/* e with acute accent */
867 	{FA_ACUTE, 'i', 0xED},		/* i with acute accent */
868 	{FA_ACUTE, 'o', 0xF3},		/* o with acute accent */
869 	{FA_ACUTE, 'u', 0xFA},		/* u with acute accent */
870 	{FA_ACUTE, 'y', 0xFD},		/* y with acute accent */
871 
872 	{FA_GRAVE, 'A', 0xC0},		/* A with grave accent */
873 	{FA_GRAVE, 'E', 0xC8},		/* E with grave accent */
874 	{FA_GRAVE, 'I', 0xCC},		/* I with grave accent */
875 	{FA_GRAVE, 'O', 0xD2},		/* O with grave accent */
876 	{FA_GRAVE, 'U', 0xD9},		/* U with grave accent */
877 	{FA_GRAVE, 'a', 0xE0},		/* a with grave accent */
878 	{FA_GRAVE, 'e', 0xE8},		/* e with grave accent */
879 	{FA_GRAVE, 'i', 0xEC},		/* i with grave accent */
880 	{FA_GRAVE, 'o', 0xF2},		/* o with grave accent */
881 	{FA_GRAVE, 'u', 0xF9},		/* u with grave accent */
882 
883 	{0, 0, 0},			/* end of table */
884 };
885 
886 /*
887  * Num Lock Table
888  */
889 
890 /* Num Lock:  pad key entry & 0x1F => ASCII character */
891 uchar_t kb_numlock_table[] = {
892 	'=',
893 	'/',
894 	'*',
895 	'-',
896 	',',
897 
898 	'7',
899 	'8',
900 	'9',
901 	'+',
902 
903 	'4',
904 	'5',
905 	'6',
906 
907 	'1',
908 	'2',
909 	'3',
910 
911 	'0',
912 	'.',
913 	'\n',	/* Enter */
914 };
915