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