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