xref: /onnv-gate/usr/src/uts/common/io/keytables.c (revision 3505:280762f431b6)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*3505Sqz150045  * Common Development and Distribution License (the "License").
6*3505Sqz150045  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*3505Sqz150045  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23*3505Sqz150045  * Use is subject to license terms.
240Sstevel@tonic-gate  */
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
270Sstevel@tonic-gate 		/* SunOS-4.0 1.19	*/
280Sstevel@tonic-gate 
290Sstevel@tonic-gate /*
300Sstevel@tonic-gate  * This module contains the translation tables for the up-down encoded
310Sstevel@tonic-gate  * Sun keyboards.
320Sstevel@tonic-gate  */
330Sstevel@tonic-gate 
340Sstevel@tonic-gate #include <sys/param.h>
350Sstevel@tonic-gate #include <sys/kbd.h>
360Sstevel@tonic-gate 
370Sstevel@tonic-gate /* handy way to define control characters in the tables */
380Sstevel@tonic-gate #define	c(c_char)	(c_char&0x1F)
390Sstevel@tonic-gate #define	ESC 0x1B
400Sstevel@tonic-gate #define	DEL 0x7F
410Sstevel@tonic-gate 
420Sstevel@tonic-gate 
430Sstevel@tonic-gate /* Unshifted keyboard table for Type 3 keyboard */
440Sstevel@tonic-gate 
450Sstevel@tonic-gate static struct keymap keytab_s3_lc = {
460Sstevel@tonic-gate /* BEGIN CSTYLED */
470Sstevel@tonic-gate /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
480Sstevel@tonic-gate 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	HOLE,
490Sstevel@tonic-gate /*  8 */	TF(3), 	HOLE,	TF(4),	HOLE,	TF(5),	HOLE,	TF(6),	HOLE,
500Sstevel@tonic-gate /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
510Sstevel@tonic-gate 						HOLE,	RF(1),	RF(2),	RF(3),
520Sstevel@tonic-gate /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'1',	'2',
530Sstevel@tonic-gate /* 32 */	'3',	'4',	'5',	'6',	'7',	'8',	'9',	'0',
540Sstevel@tonic-gate /* 40 */	'-',	'=',	'`',	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
550Sstevel@tonic-gate /* 48 */	HOLE,	LF(5),	HOLE,	LF(6),	HOLE,	'\t',	'q',	'w',
560Sstevel@tonic-gate /* 56 */	'e',	'r',	't',	'y',	'u',	'i',	'o',	'p',
570Sstevel@tonic-gate /* 64 */	'[',	']',	DEL,	HOLE,	RF(7),	STRING+UPARROW,
580Sstevel@tonic-gate 								RF(9),	HOLE,
590Sstevel@tonic-gate /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
600Sstevel@tonic-gate 							'a', 	's',	'd',
610Sstevel@tonic-gate /* 80 */	'f',	'g',	'h',	'j',	'k',	'l',	';',	'\'',
620Sstevel@tonic-gate /* 88 */	'\\',	'\r',	HOLE,	STRING+LEFTARROW,
630Sstevel@tonic-gate 						RF(11),	STRING+RIGHTARROW,
640Sstevel@tonic-gate 								HOLE,	LF(9),
650Sstevel@tonic-gate /* 96 */	HOLE,	LF(10),	HOLE,	SHIFTKEYS+LEFTSHIFT,
660Sstevel@tonic-gate 						'z',	'x',	'c',	'v',
670Sstevel@tonic-gate /*104 */	'b',	'n',	'm',	',',	'.',	'/',	SHIFTKEYS+RIGHTSHIFT,
680Sstevel@tonic-gate 									'\n',
690Sstevel@tonic-gate /*112 */	RF(13),	STRING+DOWNARROW,
700Sstevel@tonic-gate 				RF(15),	HOLE,	HOLE,	HOLE,	HOLE,	SHIFTKEYS+CAPSLOCK,
710Sstevel@tonic-gate /*120 */	BUCKYBITS+METABIT,
720Sstevel@tonic-gate 			' ',	BUCKYBITS+METABIT,
730Sstevel@tonic-gate 					HOLE,	HOLE,	HOLE,	ERROR,	IDLE,
740Sstevel@tonic-gate /* END CSTYLED */
750Sstevel@tonic-gate };
760Sstevel@tonic-gate 
770Sstevel@tonic-gate /* Shifted keyboard table for Type 3 keyboard */
780Sstevel@tonic-gate 
790Sstevel@tonic-gate static struct keymap keytab_s3_uc = {
800Sstevel@tonic-gate /* BEGIN CSTYLED */
810Sstevel@tonic-gate /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
820Sstevel@tonic-gate 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	HOLE,
830Sstevel@tonic-gate /*  8 */	TF(3), 	HOLE,	TF(4),	HOLE,	TF(5),	HOLE,	TF(6),	HOLE,
840Sstevel@tonic-gate /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
850Sstevel@tonic-gate 						HOLE,	RF(1),	RF(2),	RF(3),
860Sstevel@tonic-gate /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'!',    '@',
870Sstevel@tonic-gate /* 32 */	'#',	'$',	'%',	'^',	'&',	'*',	'(',	')',
880Sstevel@tonic-gate /* 40 */	'_',	'+',	'~',	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
890Sstevel@tonic-gate /* 48 */	HOLE,	LF(5),	HOLE,	LF(6),	HOLE,	'\t',	'Q',	'W',
900Sstevel@tonic-gate /* 56 */	'E',	'R',	'T',	'Y',	'U',	'I',	'O',	'P',
910Sstevel@tonic-gate /* 64 */	'{',	'}',	DEL,	HOLE,	RF(7),	STRING+UPARROW,
920Sstevel@tonic-gate 								RF(9),	HOLE,
930Sstevel@tonic-gate /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
940Sstevel@tonic-gate 							'A', 	'S',	'D',
950Sstevel@tonic-gate /* 80 */	'F',	'G',	'H',	'J',	'K',	'L',	':',	'"',
960Sstevel@tonic-gate /* 88 */	'|',	'\r',	HOLE,	STRING+LEFTARROW,
970Sstevel@tonic-gate 						RF(11),	STRING+RIGHTARROW,
980Sstevel@tonic-gate 								HOLE,	LF(9),
990Sstevel@tonic-gate /* 96 */	HOLE,	LF(10),	HOLE,	SHIFTKEYS+LEFTSHIFT,
1000Sstevel@tonic-gate 						'Z',	'X',	'C',	'V',
1010Sstevel@tonic-gate /*104 */	'B',	'N',	'M',	'<',	'>',	'?',	SHIFTKEYS+RIGHTSHIFT,
1020Sstevel@tonic-gate 									'\n',
1030Sstevel@tonic-gate /*112 */	RF(13),	STRING+DOWNARROW,
1040Sstevel@tonic-gate 				RF(15),	HOLE,	HOLE,	HOLE,	HOLE,	SHIFTKEYS+CAPSLOCK,
1050Sstevel@tonic-gate /*120 */	BUCKYBITS+METABIT,
1060Sstevel@tonic-gate 			' ',	BUCKYBITS+METABIT,
1070Sstevel@tonic-gate 					HOLE,	HOLE,	HOLE,	ERROR,	IDLE,
1080Sstevel@tonic-gate /* END CSTYLED */
1090Sstevel@tonic-gate };
1100Sstevel@tonic-gate 
1110Sstevel@tonic-gate /* Caps Locked keyboard table for Type 3 keyboard */
1120Sstevel@tonic-gate 
1130Sstevel@tonic-gate static struct keymap keytab_s3_cl = {
1140Sstevel@tonic-gate /* BEGIN CSTYLED */
1150Sstevel@tonic-gate /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
1160Sstevel@tonic-gate 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	HOLE,
1170Sstevel@tonic-gate /*  8 */	TF(3), 	HOLE,	TF(4),	HOLE,	TF(5),	HOLE,	TF(6),	HOLE,
1180Sstevel@tonic-gate /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
1190Sstevel@tonic-gate 						HOLE,	RF(1),	RF(2),	RF(3),
1200Sstevel@tonic-gate /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'1',	'2',
1210Sstevel@tonic-gate /* 32 */	'3',	'4',	'5',	'6',	'7',	'8',	'9',	'0',
1220Sstevel@tonic-gate /* 40 */	'-',	'=',	'`',	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
1230Sstevel@tonic-gate /* 48 */	HOLE,	LF(5),	HOLE,	LF(6),	HOLE,	'\t',	'Q',	'W',
1240Sstevel@tonic-gate /* 56 */	'E',	'R',	'T',	'Y',	'U',	'I',	'O',	'P',
1250Sstevel@tonic-gate /* 64 */	'[',	']',	DEL,	HOLE,	RF(7),	STRING+UPARROW,
1260Sstevel@tonic-gate 								RF(9),	HOLE,
1270Sstevel@tonic-gate /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
1280Sstevel@tonic-gate 							'A', 	'S',	'D',
1290Sstevel@tonic-gate /* 80 */	'F',	'G',	'H',	'J',	'K',	'L',	';',	'\'',
1300Sstevel@tonic-gate /* 88 */	'\\',	'\r',	HOLE,	STRING+LEFTARROW,
1310Sstevel@tonic-gate 						RF(11),	STRING+RIGHTARROW,
1320Sstevel@tonic-gate 								HOLE,	LF(9),
1330Sstevel@tonic-gate /* 96 */	HOLE,	LF(10),	HOLE,	SHIFTKEYS+LEFTSHIFT,
1340Sstevel@tonic-gate 						'Z',	'X',	'C',	'V',
1350Sstevel@tonic-gate /*104 */	'B',	'N',	'M',	',',	'.',	'/',	SHIFTKEYS+RIGHTSHIFT,
1360Sstevel@tonic-gate 									'\n',
1370Sstevel@tonic-gate /*112 */	RF(13),	STRING+DOWNARROW,
1380Sstevel@tonic-gate 				RF(15),	HOLE,	HOLE,	HOLE,	HOLE,	SHIFTKEYS+CAPSLOCK,
1390Sstevel@tonic-gate /*120 */	BUCKYBITS+METABIT,
1400Sstevel@tonic-gate 			' ',	BUCKYBITS+METABIT,
1410Sstevel@tonic-gate 					HOLE,	HOLE,	HOLE,	ERROR,	IDLE,
1420Sstevel@tonic-gate /* END CSTYLED */
1430Sstevel@tonic-gate };
1440Sstevel@tonic-gate 
1450Sstevel@tonic-gate /* Controlled keyboard table for Type 3 keyboard */
1460Sstevel@tonic-gate 
1470Sstevel@tonic-gate static struct keymap keytab_s3_ct = {
1480Sstevel@tonic-gate /* BEGIN CSTYLED */
1490Sstevel@tonic-gate /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
1500Sstevel@tonic-gate 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	HOLE,
1510Sstevel@tonic-gate /*  8 */	TF(3), 	HOLE,	TF(4),	HOLE,	TF(5),	HOLE,	TF(6),	HOLE,
1520Sstevel@tonic-gate /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
1530Sstevel@tonic-gate 						HOLE,	RF(1),	RF(2),	RF(3),
1540Sstevel@tonic-gate /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'1',	c('@'),
1550Sstevel@tonic-gate /* 32 */	'3',	'4',	'5',	c('^'),	'7',	'8',	'9',	'0',
1560Sstevel@tonic-gate /* 40 */	c('_'),	'=',	c('^'),	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
1570Sstevel@tonic-gate /* 48 */	HOLE,	LF(5),	HOLE,	LF(6),	HOLE,	'\t',   c('q'),	c('w'),
1580Sstevel@tonic-gate /* 56 */	c('e'),	c('r'),	c('t'),	c('y'),	c('u'),	c('i'),	c('o'),	c('p'),
1590Sstevel@tonic-gate /* 64 */	c('['),	c(']'),	DEL,	HOLE,	RF(7),	STRING+UPARROW,
1600Sstevel@tonic-gate 								RF(9),	HOLE,
1610Sstevel@tonic-gate /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
1620Sstevel@tonic-gate 							c('a'),	c('s'),	c('d'),
1630Sstevel@tonic-gate /* 80 */	c('f'),	c('g'),	c('h'),	c('j'),	c('k'),	c('l'),	';',	'\'',
1640Sstevel@tonic-gate /* 88 */	c('\\'),
1650Sstevel@tonic-gate 			'\r',	HOLE,	STRING+LEFTARROW,
1660Sstevel@tonic-gate 						RF(11),	STRING+RIGHTARROW,
1670Sstevel@tonic-gate 								HOLE,	LF(9),
1680Sstevel@tonic-gate /* 96 */	HOLE,	LF(10),	HOLE,	SHIFTKEYS+LEFTSHIFT,
1690Sstevel@tonic-gate 						c('z'),	c('x'),	c('c'),	c('v'),
1700Sstevel@tonic-gate /*104 */	c('b'),	c('n'),	c('m'),	',',	'.',	c('_'),	SHIFTKEYS+RIGHTSHIFT,
1710Sstevel@tonic-gate 									'\n',
1720Sstevel@tonic-gate /*112 */	RF(13),	STRING+DOWNARROW,
1730Sstevel@tonic-gate 				RF(15),	HOLE,	HOLE,	HOLE,	HOLE,	SHIFTKEYS+CAPSLOCK,
1740Sstevel@tonic-gate /*120 */	BUCKYBITS+METABIT,
1750Sstevel@tonic-gate 			c(' '),	BUCKYBITS+METABIT,
1760Sstevel@tonic-gate 					HOLE,	HOLE,	HOLE,	ERROR,	IDLE,
1770Sstevel@tonic-gate /* END CSTYLED */
1780Sstevel@tonic-gate };
1790Sstevel@tonic-gate 
1800Sstevel@tonic-gate /* "Key Up" keyboard table for Type 3 keyboard */
1810Sstevel@tonic-gate 
1820Sstevel@tonic-gate static struct keymap keytab_s3_up = {
1830Sstevel@tonic-gate /* BEGIN CSTYLED */
1840Sstevel@tonic-gate /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
1850Sstevel@tonic-gate 				HOLE,	NOP,	HOLE,	NOP,	NOP,	HOLE,
1860Sstevel@tonic-gate /*  8 */	NOP, 	HOLE, 	NOP,	HOLE,	NOP,	HOLE,	NOP,	HOLE,
1870Sstevel@tonic-gate /* 16 */	NOP, 	NOP, 	NOP,	SHIFTKEYS+ALT,
1880Sstevel@tonic-gate 						HOLE,	NOP,	NOP,	NOP,
1890Sstevel@tonic-gate /* 24 */	HOLE, 	NOP, 	NOP,	HOLE,	HOLE,	NOP,	NOP,	NOP,
1900Sstevel@tonic-gate /* 32 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
1910Sstevel@tonic-gate /* 40 */	NOP,	NOP,	NOP,	NOP,	HOLE,	NOP,	NOP,	NOP,
1920Sstevel@tonic-gate /* 48 */	HOLE,	NOP,	HOLE,	NOP,	HOLE,	NOP,	NOP,	NOP,
1930Sstevel@tonic-gate /* 56 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
1940Sstevel@tonic-gate /* 64 */	NOP,	NOP,	NOP,	HOLE,	NOP,	NOP,	NOP,	HOLE,
1950Sstevel@tonic-gate /* 72 */	NOP,	NOP,	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
1960Sstevel@tonic-gate 							NOP, 	NOP,	NOP,
1970Sstevel@tonic-gate /* 80 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
1980Sstevel@tonic-gate /* 88 */	NOP,	NOP,	HOLE,	NOP,	NOP,	NOP,	HOLE,	NOP,
1990Sstevel@tonic-gate /* 96 */	HOLE,	NOP,	HOLE,	SHIFTKEYS+LEFTSHIFT,
2000Sstevel@tonic-gate 						NOP,	NOP,	NOP,	NOP,
2010Sstevel@tonic-gate /*104 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	SHIFTKEYS+RIGHTSHIFT,
2020Sstevel@tonic-gate 									NOP,
2030Sstevel@tonic-gate /*112 */	NOP,	NOP,	NOP,	HOLE,	HOLE,	HOLE,	HOLE,	NOP,
2040Sstevel@tonic-gate /*120 */	BUCKYBITS+METABIT,
2050Sstevel@tonic-gate 			NOP,	BUCKYBITS+METABIT,
2060Sstevel@tonic-gate 					HOLE,	HOLE,	HOLE,	HOLE,	RESET,
2070Sstevel@tonic-gate /* END CSTYLED */
2080Sstevel@tonic-gate };
2090Sstevel@tonic-gate 
2100Sstevel@tonic-gate /* Index to keymaps for Type 3 keyboard */
2110Sstevel@tonic-gate static struct keyboard keyindex_s3 = {
2120Sstevel@tonic-gate 	&keytab_s3_lc,
2130Sstevel@tonic-gate 	&keytab_s3_uc,
2140Sstevel@tonic-gate 	&keytab_s3_cl,
2150Sstevel@tonic-gate 	0,		/* no Alt Graph key, no Alt Graph table */
2160Sstevel@tonic-gate 	0,		/* no Num Lock key, no Num Lock table */
2170Sstevel@tonic-gate 	&keytab_s3_ct,
2180Sstevel@tonic-gate 	&keytab_s3_up,
2190Sstevel@tonic-gate 	0x0000,		/* Shift bits which stay on with idle keyboard */
2200Sstevel@tonic-gate 	0x0000,		/* Bucky bits which stay on with idle keyboard */
2210Sstevel@tonic-gate 	1, 0,	77,	/* abort keys */
2220Sstevel@tonic-gate 	CAPSMASK,	/* Shift bits which toggle on down event */
2230Sstevel@tonic-gate 	NULL,
224*3505Sqz150045 	99, 110, 21,	/* New abort keys */
2250Sstevel@tonic-gate };
2260Sstevel@tonic-gate 
2270Sstevel@tonic-gate 
2280Sstevel@tonic-gate /* Unshifted keyboard table for Type 4 keyboard */
2290Sstevel@tonic-gate 
2300Sstevel@tonic-gate static struct keymap keytab_s4_lc = {
2310Sstevel@tonic-gate /* BEGIN CSTYLED */
2320Sstevel@tonic-gate /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
2330Sstevel@tonic-gate 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	TF(10),
2340Sstevel@tonic-gate /*  8 */	TF(3), 	TF(11),	TF(4),	TF(12),	TF(5),	SHIFTKEYS+ALTGRAPH,
2350Sstevel@tonic-gate 								TF(6),	HOLE,
2360Sstevel@tonic-gate /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
2370Sstevel@tonic-gate 						HOLE,	RF(1),	RF(2),	RF(3),
2380Sstevel@tonic-gate /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'1',	'2',
2390Sstevel@tonic-gate /* 32 */	'3',	'4',	'5',	'6',	'7',	'8',	'9',	'0',
2400Sstevel@tonic-gate /* 40 */	'-',	'=',	'`',	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
2410Sstevel@tonic-gate /* 48 */	BF(13),	LF(5),	BF(10),	LF(6),	HOLE,	'\t',	'q',	'w',
2420Sstevel@tonic-gate /* 56 */	'e',	'r',	't',	'y',	'u',	'i',	'o',	'p',
2430Sstevel@tonic-gate /* 64 */	'[',	']',	DEL,	COMPOSE,
2440Sstevel@tonic-gate 						RF(7),	STRING+UPARROW,
2450Sstevel@tonic-gate 								RF(9),	BF(15),
2460Sstevel@tonic-gate /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
2470Sstevel@tonic-gate 							'a', 	's',	'd',
2480Sstevel@tonic-gate /* 80 */	'f',	'g',	'h',	'j',	'k',	'l',	';',	'\'',
2490Sstevel@tonic-gate /* 88 */	'\\',	'\r',	BF(11),	STRING+LEFTARROW,
2500Sstevel@tonic-gate 						RF(11),	STRING+RIGHTARROW,
2510Sstevel@tonic-gate 								BF(8),	LF(9),
2520Sstevel@tonic-gate /* 96 */	HOLE,	LF(10),	SHIFTKEYS+NUMLOCK,
2530Sstevel@tonic-gate 					SHIFTKEYS+LEFTSHIFT,
2540Sstevel@tonic-gate 						'z',	'x',	'c',	'v',
2550Sstevel@tonic-gate /*104 */	'b',	'n',	'm',	',',	'.',	'/',	SHIFTKEYS+RIGHTSHIFT,
2560Sstevel@tonic-gate 									'\n',
2570Sstevel@tonic-gate /*112 */	RF(13),	STRING+DOWNARROW,
2580Sstevel@tonic-gate 				RF(15),	HOLE,	HOLE,	HOLE,	LF(16),	SHIFTKEYS+CAPSLOCK,
2590Sstevel@tonic-gate /*120 */	BUCKYBITS+METABIT,
2600Sstevel@tonic-gate 			' ',	BUCKYBITS+METABIT,
2610Sstevel@tonic-gate 					HOLE,	HOLE,	BF(14),	ERROR,	IDLE,
2620Sstevel@tonic-gate /* END CSTYLED */
2630Sstevel@tonic-gate };
2640Sstevel@tonic-gate 
2650Sstevel@tonic-gate /* Shifted keyboard table for Type 4 keyboard */
2660Sstevel@tonic-gate 
2670Sstevel@tonic-gate static struct keymap keytab_s4_uc = {
2680Sstevel@tonic-gate /* BEGIN CSTYLED */
2690Sstevel@tonic-gate /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
2700Sstevel@tonic-gate 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	TF(10),
2710Sstevel@tonic-gate /*  8 */	TF(3), 	TF(11),	TF(4),	TF(12),	TF(5),	SHIFTKEYS+ALTGRAPH,
2720Sstevel@tonic-gate 								TF(6),	HOLE,
2730Sstevel@tonic-gate /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
2740Sstevel@tonic-gate 						HOLE,	RF(1),	RF(2),	RF(3),
2750Sstevel@tonic-gate /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'!',    '@',
2760Sstevel@tonic-gate /* 32 */	'#',	'$',	'%',	'^',	'&',	'*',	'(',	')',
2770Sstevel@tonic-gate /* 40 */	'_',	'+',	'~',	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
2780Sstevel@tonic-gate /* 48 */	BF(13),	LF(5),	BF(10),	LF(6),	HOLE,	'\t',	'Q',	'W',
2790Sstevel@tonic-gate /* 56 */	'E',	'R',	'T',	'Y',	'U',	'I',	'O',	'P',
2800Sstevel@tonic-gate /* 64 */	'{',	'}',	DEL,	COMPOSE,
2810Sstevel@tonic-gate 						RF(7),	STRING+UPARROW,
2820Sstevel@tonic-gate 								RF(9),	BF(15),
2830Sstevel@tonic-gate /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
2840Sstevel@tonic-gate 							'A', 	'S',	'D',
2850Sstevel@tonic-gate /* 80 */	'F',	'G',	'H',	'J',	'K',	'L',	':',	'"',
2860Sstevel@tonic-gate /* 88 */	'|',	'\r',	BF(11),	STRING+LEFTARROW,
2870Sstevel@tonic-gate 						RF(11),	STRING+RIGHTARROW,
2880Sstevel@tonic-gate 								BF(8),	LF(9),
2890Sstevel@tonic-gate /* 96 */	HOLE,	LF(10),	SHIFTKEYS+NUMLOCK,
2900Sstevel@tonic-gate 					SHIFTKEYS+LEFTSHIFT,
2910Sstevel@tonic-gate 						'Z',	'X',	'C',	'V',
2920Sstevel@tonic-gate /*104 */	'B',	'N',	'M',	'<',	'>',	'?',	SHIFTKEYS+RIGHTSHIFT,
2930Sstevel@tonic-gate 									'\n',
2940Sstevel@tonic-gate /*112 */	RF(13),	STRING+DOWNARROW,
2950Sstevel@tonic-gate 				RF(15),	HOLE,	HOLE,	HOLE,	LF(16),	SHIFTKEYS+CAPSLOCK,
2960Sstevel@tonic-gate /*120 */	BUCKYBITS+METABIT,
2970Sstevel@tonic-gate 			' ',	BUCKYBITS+METABIT,
2980Sstevel@tonic-gate 					HOLE,	HOLE,	BF(14),	ERROR,	IDLE,
2990Sstevel@tonic-gate /* END CSTYLED */
3000Sstevel@tonic-gate };
3010Sstevel@tonic-gate 
3020Sstevel@tonic-gate /* Caps Locked keyboard table for Type 4 keyboard */
3030Sstevel@tonic-gate 
3040Sstevel@tonic-gate static struct keymap keytab_s4_cl = {
3050Sstevel@tonic-gate /* BEGIN CSTYLED */
3060Sstevel@tonic-gate /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
3070Sstevel@tonic-gate 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	TF(10),
3080Sstevel@tonic-gate /*  8 */	TF(3), 	TF(11),	TF(4),	TF(12),	TF(5),	SHIFTKEYS+ALTGRAPH,
3090Sstevel@tonic-gate 								TF(6),	HOLE,
3100Sstevel@tonic-gate /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
3110Sstevel@tonic-gate 						HOLE,	RF(1),	RF(2),	RF(3),
3120Sstevel@tonic-gate /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'1',	'2',
3130Sstevel@tonic-gate /* 32 */	'3',	'4',	'5',	'6',	'7',	'8',	'9',	'0',
3140Sstevel@tonic-gate /* 40 */	'-',	'=',	'`',	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
3150Sstevel@tonic-gate /* 48 */	BF(13),	LF(5),	BF(10),	LF(6),	HOLE,	'\t',	'Q',	'W',
3160Sstevel@tonic-gate /* 56 */	'E',	'R',	'T',	'Y',	'U',	'I',	'O',	'P',
3170Sstevel@tonic-gate /* 64 */	'[',	']',	DEL,	COMPOSE,
3180Sstevel@tonic-gate 						RF(7),	STRING+UPARROW,
3190Sstevel@tonic-gate 								RF(9),	BF(15),
3200Sstevel@tonic-gate /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
3210Sstevel@tonic-gate 							'A', 	'S',	'D',
3220Sstevel@tonic-gate /* 80 */	'F',	'G',	'H',	'J',	'K',	'L',	';',	'\'',
3230Sstevel@tonic-gate /* 88 */	'\\',	'\r',	BF(11),	STRING+LEFTARROW,
3240Sstevel@tonic-gate 						RF(11),	STRING+RIGHTARROW,
3250Sstevel@tonic-gate 								BF(8),	LF(9),
3260Sstevel@tonic-gate /* 96 */	HOLE,	LF(10),	SHIFTKEYS+NUMLOCK,
3270Sstevel@tonic-gate 					SHIFTKEYS+LEFTSHIFT,
3280Sstevel@tonic-gate 						'Z',	'X',	'C',	'V',
3290Sstevel@tonic-gate /*104 */	'B',	'N',	'M',	',',	'.',	'/',	SHIFTKEYS+RIGHTSHIFT,
3300Sstevel@tonic-gate 									'\n',
3310Sstevel@tonic-gate /*112 */	RF(13),	STRING+DOWNARROW,
3320Sstevel@tonic-gate 				RF(15),	HOLE,	HOLE,	HOLE,	LF(16),	SHIFTKEYS+CAPSLOCK,
3330Sstevel@tonic-gate /*120 */	BUCKYBITS+METABIT,
3340Sstevel@tonic-gate 			' ',	BUCKYBITS+METABIT,
3350Sstevel@tonic-gate 					HOLE,	HOLE,	BF(14),	ERROR,	IDLE,
3360Sstevel@tonic-gate /* END CSTYLED */
3370Sstevel@tonic-gate };
3380Sstevel@tonic-gate 
3390Sstevel@tonic-gate /* Alt Graph keyboard table for Type 4 keyboard */
3400Sstevel@tonic-gate 
3410Sstevel@tonic-gate static struct keymap keytab_s4_ag = {
3420Sstevel@tonic-gate /* BEGIN CSTYLED */
3430Sstevel@tonic-gate /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
3440Sstevel@tonic-gate 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	TF(10),
3450Sstevel@tonic-gate /*  8 */	TF(3), 	TF(11),	TF(4),	TF(12),	TF(5),	SHIFTKEYS+ALTGRAPH,
3460Sstevel@tonic-gate 								TF(6),	HOLE,
3470Sstevel@tonic-gate /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
3480Sstevel@tonic-gate 						HOLE,	RF(1),	RF(2),	RF(3),
3490Sstevel@tonic-gate /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	NOP,	NOP,
3500Sstevel@tonic-gate /* 32 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
3510Sstevel@tonic-gate /* 40 */	NOP,	NOP,	NOP,	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
3520Sstevel@tonic-gate /* 48 */	BF(13),	LF(5),	BF(10),	LF(6),	HOLE,	'\t',	NOP,	NOP,
3530Sstevel@tonic-gate /* 56 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
3540Sstevel@tonic-gate /* 64 */	NOP,	NOP,	DEL,	COMPOSE,
3550Sstevel@tonic-gate 						RF(7),	STRING+UPARROW,
3560Sstevel@tonic-gate 								RF(9),	BF(15),
3570Sstevel@tonic-gate /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
3580Sstevel@tonic-gate 							NOP, 	NOP,	NOP,
3590Sstevel@tonic-gate /* 80 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
3600Sstevel@tonic-gate /* 88 */	NOP,	'\r',	BF(11),	STRING+LEFTARROW,
3610Sstevel@tonic-gate 						RF(11),	STRING+RIGHTARROW,
3620Sstevel@tonic-gate 								BF(8),	LF(9),
3630Sstevel@tonic-gate /* 96 */	HOLE,	LF(10),	SHIFTKEYS+NUMLOCK,
3640Sstevel@tonic-gate 					SHIFTKEYS+LEFTSHIFT,
3650Sstevel@tonic-gate 						NOP,	NOP,	NOP,	NOP,
3660Sstevel@tonic-gate /*104 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	SHIFTKEYS+RIGHTSHIFT,
3670Sstevel@tonic-gate 									'\n',
3680Sstevel@tonic-gate /*112 */	RF(13),	STRING+DOWNARROW,
3690Sstevel@tonic-gate 				RF(15),	HOLE,	HOLE,	HOLE,	LF(16),	SHIFTKEYS+CAPSLOCK,
3700Sstevel@tonic-gate /*120 */	BUCKYBITS+METABIT,
3710Sstevel@tonic-gate 			' ',	BUCKYBITS+METABIT,
3720Sstevel@tonic-gate 					HOLE,	HOLE,	BF(14),	ERROR,	IDLE,
3730Sstevel@tonic-gate /* END CSTYLED */
3740Sstevel@tonic-gate };
3750Sstevel@tonic-gate 
3760Sstevel@tonic-gate /* Num Locked keyboard table for Type 4 keyboard */
3770Sstevel@tonic-gate 
3780Sstevel@tonic-gate static struct keymap keytab_s4_nl = {
3790Sstevel@tonic-gate /* BEGIN CSTYLED */
3800Sstevel@tonic-gate /*  0 */	HOLE,	NONL,	HOLE,	NONL,	HOLE,	NONL,	NONL,	NONL,
3810Sstevel@tonic-gate /*  8 */	NONL, 	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	HOLE,
3820Sstevel@tonic-gate /* 16 */	NONL,	NONL,	NONL,	NONL,	HOLE,	NONL,	NONL,	NONL,
3830Sstevel@tonic-gate /* 24 */	HOLE, 	NONL, 	NONL,	HOLE,	HOLE,	NONL,	NONL,	NONL,
3840Sstevel@tonic-gate /* 32 */	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,
3850Sstevel@tonic-gate /* 40 */	NONL,	NONL,	NONL,	NONL,	HOLE,	PADEQUAL,
3860Sstevel@tonic-gate 								PADSLASH,
3870Sstevel@tonic-gate 									PADSTAR,
3880Sstevel@tonic-gate /* 48 */	NONL,	NONL,	PADDOT,	NONL,	HOLE,	NONL,	NONL,	NONL,
3890Sstevel@tonic-gate /* 56 */	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,
3900Sstevel@tonic-gate /* 64 */	NONL,	NONL,	NONL,	NONL,
3910Sstevel@tonic-gate 						PAD7,	PAD8,	PAD9,	PADMINUS,
3920Sstevel@tonic-gate /* 72 */	NONL,	NONL,	HOLE,	HOLE,	NONL,	NONL, 	NONL,	NONL,
3930Sstevel@tonic-gate /* 80 */	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,
3940Sstevel@tonic-gate /* 88 */	NONL,	NONL,	PADENTER,
3950Sstevel@tonic-gate 					PAD4,	PAD5,	PAD6,	PAD0,	NONL,
3960Sstevel@tonic-gate /* 96 */	HOLE,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,
3970Sstevel@tonic-gate /*104 */	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,	NONL,
3980Sstevel@tonic-gate 									NONL,
3990Sstevel@tonic-gate /*112 */	PAD1,	PAD2,	PAD3,	HOLE,	HOLE,	HOLE,	NONL,	NONL,
4000Sstevel@tonic-gate /*120 */	NONL,	NONL,	NONL,	HOLE,	HOLE,	PADPLUS,
4010Sstevel@tonic-gate 								ERROR,	IDLE,
4020Sstevel@tonic-gate /* END CSTYLED */
4030Sstevel@tonic-gate };
4040Sstevel@tonic-gate 
4050Sstevel@tonic-gate /* Controlled keyboard table for Type 4 keyboard */
4060Sstevel@tonic-gate 
4070Sstevel@tonic-gate static struct keymap keytab_s4_ct = {
4080Sstevel@tonic-gate /* BEGIN CSTYLED */
4090Sstevel@tonic-gate /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
4100Sstevel@tonic-gate 				HOLE,	LF(2),	HOLE,	TF(1),	TF(2),	TF(10),
4110Sstevel@tonic-gate /*  8 */	TF(3), 	TF(11),	TF(4),	TF(12),	TF(5),	SHIFTKEYS+ALTGRAPH,
4120Sstevel@tonic-gate 								TF(6),	HOLE,
4130Sstevel@tonic-gate /* 16 */	TF(7),	TF(8),	TF(9),	SHIFTKEYS+ALT,
4140Sstevel@tonic-gate 						HOLE,	RF(1),	RF(2),	RF(3),
4150Sstevel@tonic-gate /* 24 */	HOLE, 	LF(3), 	LF(4),	HOLE,	HOLE,	ESC,	'1',	c('@'),
4160Sstevel@tonic-gate /* 32 */	'3',	'4',	'5',	c('^'),	'7',	'8',	'9',	'0',
4170Sstevel@tonic-gate /* 40 */	c('_'),	'=',	c('^'),	'\b',	HOLE,	RF(4),	RF(5),	RF(6),
4180Sstevel@tonic-gate /* 48 */	BF(13),	LF(5),	BF(10),	LF(6),	HOLE,	'\t',   c('q'),	c('w'),
4190Sstevel@tonic-gate /* 56 */	c('e'),	c('r'),	c('t'),	c('y'),	c('u'),	c('i'),	c('o'),	c('p'),
4200Sstevel@tonic-gate /* 64 */	c('['),	c(']'),	DEL,	COMPOSE,
4210Sstevel@tonic-gate 						RF(7),	STRING+UPARROW,
4220Sstevel@tonic-gate 								RF(9),	BF(15),
4230Sstevel@tonic-gate /* 72 */	LF(7),	LF(8),	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
4240Sstevel@tonic-gate 							c('a'),	c('s'),	c('d'),
4250Sstevel@tonic-gate /* 80 */	c('f'),	c('g'),	c('h'),	c('j'),	c('k'),	c('l'),	';',	'\'',
4260Sstevel@tonic-gate /* 88 */	c('\\'),
4270Sstevel@tonic-gate 			'\r',	BF(11),	STRING+LEFTARROW,
4280Sstevel@tonic-gate 						RF(11),	STRING+RIGHTARROW,
4290Sstevel@tonic-gate 								BF(8),	LF(9),
4300Sstevel@tonic-gate /* 96 */	HOLE,	LF(10),	SHIFTKEYS+NUMLOCK,
4310Sstevel@tonic-gate 					SHIFTKEYS+LEFTSHIFT,
4320Sstevel@tonic-gate 						c('z'),	c('x'),	c('c'),	c('v'),
4330Sstevel@tonic-gate /*104 */	c('b'),	c('n'),	c('m'),	',',	'.',	c('_'),	SHIFTKEYS+RIGHTSHIFT,
4340Sstevel@tonic-gate 									'\n',
4350Sstevel@tonic-gate /*112 */	RF(13),	STRING+DOWNARROW,
4360Sstevel@tonic-gate 				RF(15),	HOLE,	HOLE,	HOLE,	LF(16),	SHIFTKEYS+CAPSLOCK,
4370Sstevel@tonic-gate /*120 */	BUCKYBITS+METABIT,
4380Sstevel@tonic-gate 			c(' '),	BUCKYBITS+METABIT,
4390Sstevel@tonic-gate 					HOLE,	HOLE,	BF(14),	ERROR,	IDLE,
4400Sstevel@tonic-gate /* END CSTYLED */
4410Sstevel@tonic-gate };
4420Sstevel@tonic-gate 
4430Sstevel@tonic-gate /* "Key Up" keyboard table for Type 4 keyboard */
4440Sstevel@tonic-gate 
4450Sstevel@tonic-gate static struct keymap keytab_s4_up = {
4460Sstevel@tonic-gate /* BEGIN CSTYLED */
4470Sstevel@tonic-gate /*  0 */	HOLE,	BUCKYBITS+SYSTEMBIT,
4480Sstevel@tonic-gate 				HOLE,	NOP,	HOLE,	NOP,	NOP,	NOP,
4490Sstevel@tonic-gate /*  8 */	NOP, 	NOP, 	NOP,	NOP,	NOP,	SHIFTKEYS+ALTGRAPH,
4500Sstevel@tonic-gate 								NOP,	HOLE,
4510Sstevel@tonic-gate /* 16 */	NOP, 	NOP, 	NOP,	SHIFTKEYS+ALT,
4520Sstevel@tonic-gate 						HOLE,	NOP,	NOP,	NOP,
4530Sstevel@tonic-gate /* 24 */	HOLE, 	NOP, 	NOP,	HOLE,	HOLE,	NOP,	NOP,	NOP,
4540Sstevel@tonic-gate /* 32 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
4550Sstevel@tonic-gate /* 40 */	NOP,	NOP,	NOP,	NOP,	HOLE,	NOP,	NOP,	NOP,
4560Sstevel@tonic-gate /* 48 */	NOP,	NOP,	NOP,	NOP,	HOLE,	NOP,	NOP,	NOP,
4570Sstevel@tonic-gate /* 56 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
4580Sstevel@tonic-gate /* 64 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
4590Sstevel@tonic-gate /* 72 */	NOP,	NOP,	HOLE,	HOLE,	SHIFTKEYS+LEFTCTRL,
4600Sstevel@tonic-gate 							NOP, 	NOP,	NOP,
4610Sstevel@tonic-gate /* 80 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
4620Sstevel@tonic-gate /* 88 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,
4630Sstevel@tonic-gate /* 96 */	HOLE,	NOP,	NOP,
4640Sstevel@tonic-gate 					SHIFTKEYS+LEFTSHIFT,
4650Sstevel@tonic-gate 						NOP,	NOP,	NOP,	NOP,
4660Sstevel@tonic-gate /*104 */	NOP,	NOP,	NOP,	NOP,	NOP,	NOP,	SHIFTKEYS+RIGHTSHIFT,
4670Sstevel@tonic-gate 									NOP,
4680Sstevel@tonic-gate /*112 */	NOP,	NOP,	NOP,	HOLE,	HOLE,	HOLE,	NOP,	NOP,
4690Sstevel@tonic-gate /*120 */	BUCKYBITS+METABIT,
4700Sstevel@tonic-gate 			NOP,	BUCKYBITS+METABIT,
4710Sstevel@tonic-gate 					HOLE,	HOLE,	NOP,	HOLE,	RESET,
4720Sstevel@tonic-gate /* END CSTYLED */
4730Sstevel@tonic-gate };
4740Sstevel@tonic-gate 
4750Sstevel@tonic-gate /* Index to keymaps for Type 4 keyboard */
4760Sstevel@tonic-gate static struct keyboard keyindex_s4 = {
4770Sstevel@tonic-gate 	&keytab_s4_lc,
4780Sstevel@tonic-gate 	&keytab_s4_uc,
4790Sstevel@tonic-gate 	&keytab_s4_cl,
4800Sstevel@tonic-gate 	&keytab_s4_ag,
4810Sstevel@tonic-gate 	&keytab_s4_nl,
4820Sstevel@tonic-gate 	&keytab_s4_ct,
4830Sstevel@tonic-gate 	&keytab_s4_up,
4840Sstevel@tonic-gate 	0x0000,		/* Shift bits which stay on with idle keyboard */
4850Sstevel@tonic-gate 	0x0000,		/* Bucky bits which stay on with idle keyboard */
4860Sstevel@tonic-gate 	1, 0,	77,	/* abort keys */
4870Sstevel@tonic-gate 	CAPSMASK|NUMLOCKMASK,	/* Shift bits which toggle on down event */
4880Sstevel@tonic-gate 	NULL,
489*3505Sqz150045 	99, 110, 21,	/* New abort keys */
4900Sstevel@tonic-gate };
4910Sstevel@tonic-gate 
4920Sstevel@tonic-gate 
4930Sstevel@tonic-gate /*
4940Sstevel@tonic-gate  * Index table for the whole shebang
4950Sstevel@tonic-gate  * The first entry is used as the default if the id isn't recognized.
4960Sstevel@tonic-gate  */
4970Sstevel@tonic-gate struct keyboards keytables[] = {
4980Sstevel@tonic-gate 	KB_SUN3,	&keyindex_s3,
4990Sstevel@tonic-gate 	KB_SUN4,	&keyindex_s4,
5000Sstevel@tonic-gate 	0,		NULL,
5010Sstevel@tonic-gate };
5020Sstevel@tonic-gate 
5030Sstevel@tonic-gate /*
5040Sstevel@tonic-gate  * Keyboard String Table
5050Sstevel@tonic-gate  *
5060Sstevel@tonic-gate  * This defines the strings sent by various keys (as selected in the
5070Sstevel@tonic-gate  * tables above).
5080Sstevel@tonic-gate  * The first byte of each string is its length, the rest is data.
5090Sstevel@tonic-gate  */
5100Sstevel@tonic-gate 
5110Sstevel@tonic-gate #ifdef	__STDC__
5120Sstevel@tonic-gate /*
5130Sstevel@tonic-gate  * XXX	This is here to silence compiler warnings. The non-ansi-c form
5140Sstevel@tonic-gate  *	is retained if somebody can figure out how to replicate it in
5150Sstevel@tonic-gate  *	ansi-c.
5160Sstevel@tonic-gate  */
5170Sstevel@tonic-gate char keystringtab[16][KTAB_STRLEN] = {
5180Sstevel@tonic-gate 	{ '\033', '[', 'H', '\0' },	/* home */
5190Sstevel@tonic-gate 	{ '\033', '[', 'A', '\0' },	/* up */
5200Sstevel@tonic-gate 	{ '\033', '[', 'B', '\0' },	/* down */
5210Sstevel@tonic-gate 	{ '\033', '[', 'D', '\0' },	/* left */
5220Sstevel@tonic-gate 	{ '\033', '[', 'C', '\0' },	/* right */
5230Sstevel@tonic-gate };
5240Sstevel@tonic-gate #else	/* __STDC__ */
5250Sstevel@tonic-gate #define	kstescinit(c)	{'\033', '[', 'c', '\0'}
5260Sstevel@tonic-gate char keystringtab[16][KTAB_STRLEN] = {
5270Sstevel@tonic-gate 	kstescinit(H) /* home */,
5280Sstevel@tonic-gate 	kstescinit(A) /* up */,
5290Sstevel@tonic-gate 	kstescinit(B) /* down */,
5300Sstevel@tonic-gate 	kstescinit(D) /* left */,
5310Sstevel@tonic-gate 	kstescinit(C) /* right */,
5320Sstevel@tonic-gate };
5330Sstevel@tonic-gate #endif	/* __STDC__ */
5340Sstevel@tonic-gate 
5350Sstevel@tonic-gate 
5360Sstevel@tonic-gate /*
5370Sstevel@tonic-gate  * Compose Key Sequence Table
5380Sstevel@tonic-gate  *
5390Sstevel@tonic-gate  * Taken from Suncompose.h of openwindows.
5400Sstevel@tonic-gate  *
5410Sstevel@tonic-gate  * The idea here is to create a simple index into a table of
5420Sstevel@tonic-gate  * compose key sequences.  The purpose is to provide a fast
5430Sstevel@tonic-gate  * lookup mechanism using as little space as possible (while
5440Sstevel@tonic-gate  * still using a table of triplets).
5450Sstevel@tonic-gate  *
5460Sstevel@tonic-gate  * For reference, here is the set of all composable characters:
5470Sstevel@tonic-gate  * SP !\"\'*+,-./01234:<>?ACDEHILNOPRSTUXY\\^_`acdehilnoprstuxy|~
5480Sstevel@tonic-gate  *
5490Sstevel@tonic-gate  * if ascii_char[i] is not composable,
5500Sstevel@tonic-gate  *	kb_compose_map[i] is -1
5510Sstevel@tonic-gate  * else
5520Sstevel@tonic-gate  * 	if ascii_char[i] appears as a first char in compose_table,
5530Sstevel@tonic-gate  *		kb_compose_map[i] is the index of it's first appearance
5540Sstevel@tonic-gate  *	else
5550Sstevel@tonic-gate  *		kb_compose_map[i] is 112	(end of table)
5560Sstevel@tonic-gate  */
5570Sstevel@tonic-gate 
5580Sstevel@tonic-gate signed char kb_compose_map[ASCII_SET_SIZE] = {
5590Sstevel@tonic-gate /* BEGIN CSTYLED */
5600Sstevel@tonic-gate 	 -1,	/* 000 (^@) */
5610Sstevel@tonic-gate 	 -1,	/* 001 (^A) */
5620Sstevel@tonic-gate 	 -1,	/* 002 (^B) */
5630Sstevel@tonic-gate 	 -1,	/* 003 (^C) */
5640Sstevel@tonic-gate 	 -1,	/* 004 (^D) */
5650Sstevel@tonic-gate 	 -1,	/* 005 (^E) */
5660Sstevel@tonic-gate 	 -1,	/* 006 (^F) */
5670Sstevel@tonic-gate 	 -1,	/* 007 (^G) */
5680Sstevel@tonic-gate 	 -1,	/* 008 (^H) */
5690Sstevel@tonic-gate 	 -1,	/* 009 (^I) */
5700Sstevel@tonic-gate 	 -1,	/* 010 (^J) */
5710Sstevel@tonic-gate 	 -1,	/* 011 (^K) */
5720Sstevel@tonic-gate 	 -1,	/* 012 (^L) */
5730Sstevel@tonic-gate 	 -1,	/* 013 (^M) */
5740Sstevel@tonic-gate 	 -1,	/* 014 (^N) */
5750Sstevel@tonic-gate 	 -1,	/* 015 (^O) */
5760Sstevel@tonic-gate 	 -1,	/* 016 (^P) */
5770Sstevel@tonic-gate 	 -1,	/* 017 (^Q) */
5780Sstevel@tonic-gate 	 -1,	/* 018 (^R) */
5790Sstevel@tonic-gate 	 -1,	/* 019 (^S) */
5800Sstevel@tonic-gate 	 -1,	/* 020 (^T) */
5810Sstevel@tonic-gate 	 -1,	/* 021 (^U) */
5820Sstevel@tonic-gate 	 -1,	/* 022 (^V) */
5830Sstevel@tonic-gate 	 -1,	/* 023 (^W) */
5840Sstevel@tonic-gate 	 -1,	/* 024 (^X) */
5850Sstevel@tonic-gate 	 -1,	/* 025 (^Y) */
5860Sstevel@tonic-gate 	 -1,	/* 026 (^Z) */
5870Sstevel@tonic-gate 	 -1,	/* 027 (^[) */
5880Sstevel@tonic-gate 	 -1,	/* 028 (^\) */
5890Sstevel@tonic-gate 	 -1,	/* 029 (^]) */
5900Sstevel@tonic-gate 	 -1,	/* 030 (^^) */
5910Sstevel@tonic-gate 	 -1,	/* 031 (^_) */
5920Sstevel@tonic-gate 	  0,	/* 032 (SP) */
5930Sstevel@tonic-gate 	  1,	/* 033 (!) */
5940Sstevel@tonic-gate 	  4,	/* 034 (") */
5950Sstevel@tonic-gate 	 -1,	/* 035 (#) */
5960Sstevel@tonic-gate 	 -1,	/* 036 ($) */
5970Sstevel@tonic-gate 	 -1,	/* 037 (%) */
5980Sstevel@tonic-gate 	 -1,	/* 038 (&) */
5990Sstevel@tonic-gate 	 16,	/* 039 (') */
6000Sstevel@tonic-gate 	 -1,	/* 040 (() */
6010Sstevel@tonic-gate 	 -1,	/* 041 ()) */
6020Sstevel@tonic-gate 	 28,	/* 042 (*) */
6030Sstevel@tonic-gate 	 31,	/* 043 (+) */
6040Sstevel@tonic-gate 	 32,	/* 044 (,) */
6050Sstevel@tonic-gate 	 36,	/* 045 (-) */
6060Sstevel@tonic-gate 	 48,	/* 046 (.) */
6070Sstevel@tonic-gate 	 49,	/* 047 (/) */
6080Sstevel@tonic-gate 	 54,	/* 048 (0) */
6090Sstevel@tonic-gate 	 57,	/* 049 (1) */
6100Sstevel@tonic-gate 	 60,	/* 050 (2) */
6110Sstevel@tonic-gate 	 61,	/* 051 (3) */
6120Sstevel@tonic-gate 	112,	/* 052 (4) */
6130Sstevel@tonic-gate 	 -1,	/* 053 (5) */
6140Sstevel@tonic-gate 	 -1,	/* 054 (6) */
6150Sstevel@tonic-gate 	 -1,	/* 055 (7) */
6160Sstevel@tonic-gate 	 -1,	/* 056 (8) */
6170Sstevel@tonic-gate 	 -1,	/* 057 (9) */
6180Sstevel@tonic-gate 	112,	/* 058 (:) */
6190Sstevel@tonic-gate 	 -1,	/* 059 (;) */
6200Sstevel@tonic-gate 	 63,	/* 060 (<) */
6210Sstevel@tonic-gate 	 -1,	/* 061 (=) */
6220Sstevel@tonic-gate 	 64,	/* 062 (>) */
6230Sstevel@tonic-gate 	 65,	/* 063 (?) */
6240Sstevel@tonic-gate 	 -1,	/* 064 (@) */
6250Sstevel@tonic-gate 	 66,	/* 065 (A) */
6260Sstevel@tonic-gate 	 -1,	/* 066 (B) */
6270Sstevel@tonic-gate 	 70,	/* 067 (C) */
6280Sstevel@tonic-gate 	112,	/* 068 (D) */
6290Sstevel@tonic-gate 	 71,	/* 069 (E) */
6300Sstevel@tonic-gate 	 -1,	/* 070 (F) */
6310Sstevel@tonic-gate 	 -1,	/* 071 (G) */
6320Sstevel@tonic-gate 	 73,	/* 072 (H) */
6330Sstevel@tonic-gate 	 74,	/* 073 (I) */
6340Sstevel@tonic-gate 	 -1,	/* 074 (J) */
6350Sstevel@tonic-gate 	 -1,	/* 075 (K) */
6360Sstevel@tonic-gate 	112,	/* 076 (L) */
6370Sstevel@tonic-gate 	 -1,	/* 077 (M) */
6380Sstevel@tonic-gate 	 76,	/* 078 (N) */
6390Sstevel@tonic-gate 	 77,	/* 079 (O) */
6400Sstevel@tonic-gate 	 84,	/* 080 (P) */
6410Sstevel@tonic-gate 	 -1,	/* 081 (Q) */
6420Sstevel@tonic-gate 	112,	/* 082 (R) */
6430Sstevel@tonic-gate 	112,	/* 083 (S) */
6440Sstevel@tonic-gate 	112,	/* 084 (T) */
6450Sstevel@tonic-gate 	 85,	/* 085 (U) */
6460Sstevel@tonic-gate 	 -1,	/* 086 (V) */
6470Sstevel@tonic-gate 	 -1,	/* 087 (W) */
6480Sstevel@tonic-gate 	112,	/* 088 (X) */
6490Sstevel@tonic-gate 	112,	/* 089 (Y) */
6500Sstevel@tonic-gate 	 -1,	/* 090 (Z) */
6510Sstevel@tonic-gate 	 -1,	/* 091 ([) */
6520Sstevel@tonic-gate 	 87,	/* 092 (\) */
6530Sstevel@tonic-gate 	 -1,	/* 093 (]) */
6540Sstevel@tonic-gate 	 88,	/* 094 (^) */
6550Sstevel@tonic-gate 	 93,	/* 095 (_) */
6560Sstevel@tonic-gate 	 94,	/* 096 (`) */
6570Sstevel@tonic-gate 	 99,	/* 097 (a) */
6580Sstevel@tonic-gate 	 -1,	/* 098 (b) */
6590Sstevel@tonic-gate 	101,	/* 099 (c) */
6600Sstevel@tonic-gate 	112,	/* 100 (d) */
6610Sstevel@tonic-gate 	112,	/* 101 (e) */
6620Sstevel@tonic-gate 	 -1,	/* 102 (f) */
6630Sstevel@tonic-gate 	 -1,	/* 103 (g) */
6640Sstevel@tonic-gate 	102,	/* 104 (h) */
6650Sstevel@tonic-gate 	112,	/* 105 (i) */
6660Sstevel@tonic-gate 	 -1,	/* 106 (j) */
6670Sstevel@tonic-gate 	 -1,	/* 107 (k) */
6680Sstevel@tonic-gate 	112,	/* 108 (l) */
6690Sstevel@tonic-gate 	 -1,	/* 109 (m) */
6700Sstevel@tonic-gate 	103,	/* 110 (n) */
6710Sstevel@tonic-gate 	104,	/* 111 (o) */
6720Sstevel@tonic-gate 	108,	/* 112 (p) */
6730Sstevel@tonic-gate 	 -1,	/* 113 (q) */
6740Sstevel@tonic-gate 	112,	/* 114 (r) */
6750Sstevel@tonic-gate 	109,	/* 115 (s) */
6760Sstevel@tonic-gate 	112,	/* 116 (t) */
6770Sstevel@tonic-gate 	112,	/* 117 (u) */
6780Sstevel@tonic-gate 	 -1,	/* 118 (v) */
6790Sstevel@tonic-gate 	 -1,	/* 119 (w) */
6800Sstevel@tonic-gate 	110,	/* 120 (x) */
6810Sstevel@tonic-gate 	112,	/* 121 (y) */
6820Sstevel@tonic-gate 	 -1,	/* 122 (z) */
6830Sstevel@tonic-gate 	 -1,	/* 123 ({) */
6840Sstevel@tonic-gate 	111,	/* 124 (|) */
6850Sstevel@tonic-gate 	 -1,	/* 125 (}) */
6860Sstevel@tonic-gate 	112,	/* 126 (~) */
6870Sstevel@tonic-gate 	 -1,	/* 127 (DEL) */
6880Sstevel@tonic-gate /* END CSTYLED */
6890Sstevel@tonic-gate };
6900Sstevel@tonic-gate 
6910Sstevel@tonic-gate /*
6920Sstevel@tonic-gate  * IMPORTANT NOTE:  This table MUST be kept in proper sorted order:
6930Sstevel@tonic-gate  * 	The first and second characters in each entry must be in ASCII
6940Sstevel@tonic-gate  *	    collating sequence (left to right).
6950Sstevel@tonic-gate  *	The table must be in ASCII collating sequence by first character
6960Sstevel@tonic-gate  *	    (top to bottom).
6970Sstevel@tonic-gate  */
6980Sstevel@tonic-gate 
6990Sstevel@tonic-gate /* COMPOSE + first character + second character => ISO character */
7000Sstevel@tonic-gate 
7010Sstevel@tonic-gate struct compose_sequence_t kb_compose_table[] = {
7020Sstevel@tonic-gate 
7030Sstevel@tonic-gate /* BEGIN CSTYLED */
7040Sstevel@tonic-gate 	{' ', ' ', 0xA0},	/* 000 */	/* NBSP (non-breaking space) */
7050Sstevel@tonic-gate 	{'!', '!', 0xA1},	/* 001 */	/* inverted ! */
7060Sstevel@tonic-gate 	{'!', 'P', 0xB6},	/* 002 */	/* paragraph mark */
7070Sstevel@tonic-gate 	{'!', 'p', 0xB6},	/* 003 */	/* paragraph mark */
7080Sstevel@tonic-gate 	{'"', '"', 0xA8},	/* 004 */	/* diaresis */
7090Sstevel@tonic-gate 	{'"', 'A', 0xC4},	/* 005 */	/* A with diaresis */
7100Sstevel@tonic-gate 	{'"', 'E', 0xCB},	/* 006 */	/* E with diaresis */
7110Sstevel@tonic-gate 	{'"', 'I', 0xCF},	/* 007 */	/* I with diaresis */
7120Sstevel@tonic-gate 	{'"', 'O', 0xD6},	/* 008 */	/* O with diaresis */
7130Sstevel@tonic-gate 	{'"', 'U', 0xDC},	/* 009 */	/* U with diaresis */
7140Sstevel@tonic-gate 	{'"', 'a', 0xE4},	/* 010 */	/* a with diaresis */
7150Sstevel@tonic-gate 	{'"', 'e', 0xEB},	/* 011 */	/* e with diaresis */
7160Sstevel@tonic-gate 	{'"', 'i', 0xEF},	/* 012 */	/* i with diaresis */
7170Sstevel@tonic-gate 	{'"', 'o', 0xF6},	/* 013 */	/* o with diaresis */
7180Sstevel@tonic-gate 	{'"', 'u', 0xFC},	/* 014 */	/* u with diaresis */
7190Sstevel@tonic-gate 	{'"', 'y', 0xFF},	/* 015 */	/* y with diaresis */
7200Sstevel@tonic-gate 	{'\'','A', 0xC1},	/* 016 */	/* A with acute accent */
7210Sstevel@tonic-gate 	{'\'','E', 0xC9},	/* 017 */	/* E with acute accent */
7220Sstevel@tonic-gate 	{'\'','I', 0xCD},	/* 018 */	/* I with acute accent */
7230Sstevel@tonic-gate 	{'\'','O', 0xD3},	/* 019 */	/* O with acute accent */
7240Sstevel@tonic-gate 	{'\'','U', 0xDA},	/* 020 */	/* U with acute accent */
7250Sstevel@tonic-gate 	{'\'','Y', 0xDD},	/* 021 */	/* Y with acute accent */
7260Sstevel@tonic-gate 	{'\'','a', 0xE1},	/* 022 */	/* a with acute accent */
7270Sstevel@tonic-gate 	{'\'','e', 0xE9},	/* 023 */	/* e with acute accent */
7280Sstevel@tonic-gate 	{'\'','i', 0xED},	/* 024 */	/* i with acute accent */
7290Sstevel@tonic-gate 	{'\'','o', 0xF3},	/* 025 */	/* o with acute accent */
7300Sstevel@tonic-gate 	{'\'','u', 0xFA},	/* 026 */	/* u with acute accent */
7310Sstevel@tonic-gate 	{'\'','y', 0xFD},	/* 027 */	/* y with acute accent */
7320Sstevel@tonic-gate 	{'*', 'A', 0xC5},	/* 028 */	/* A with ring */
7330Sstevel@tonic-gate 	{'*', '^', 0xB0},	/* 029 */	/* degree */
7340Sstevel@tonic-gate 	{'*', 'a', 0xE5},	/* 030 */	/* a with ring */
7350Sstevel@tonic-gate 	{'+', '-', 0xB1},	/* 031 */	/* plus/minus */
7360Sstevel@tonic-gate 	{',', ',', 0xB8},	/* 032 */	/* cedilla */
7370Sstevel@tonic-gate 	{',', '-', 0xAC},	/* 033 */	/* not sign */
7380Sstevel@tonic-gate 	{',', 'C', 0xC7},	/* 034 */	/* C with cedilla */
7390Sstevel@tonic-gate 	{',', 'c', 0xE7},	/* 035 */	/* c with cedilla */
7400Sstevel@tonic-gate 	{'-', '-', 0xAD},	/* 036 */	/* soft hyphen */
7410Sstevel@tonic-gate 	{'-', ':', 0xF7},	/* 037 */	/* division sign */
7420Sstevel@tonic-gate 	{'-', 'A', 0xAA},	/* 038 */	/* feminine superior numeral */
7430Sstevel@tonic-gate 	{'-', 'D', 0xD0},	/* 039 */	/* Upper-case eth */
7440Sstevel@tonic-gate 	{'-', 'L', 0xA3},	/* 040 */	/* pounds sterling */
7450Sstevel@tonic-gate 	{'-', 'Y', 0xA5},	/* 041 */	/* yen */
7460Sstevel@tonic-gate 	{'-', '^', 0xAF},	/* 042 */	/* macron */
7470Sstevel@tonic-gate 	{'-', 'a', 0xAA},	/* 043 */	/* feminine superior numeral */
7480Sstevel@tonic-gate 	{'-', 'd', 0xF0},	/* 044 */	/* Lower-case eth */
7490Sstevel@tonic-gate 	{'-', 'l', 0xA3},	/* 045 */	/* pounds sterling */
7500Sstevel@tonic-gate 	{'-', 'y', 0xA5},	/* 046 */	/* yen */
7510Sstevel@tonic-gate 	{'-', '|', 0xAC},	/* 047 */	/* not sign */
7520Sstevel@tonic-gate 	{'.', '^', 0xB7},	/* 048 */	/* centered dot */
7530Sstevel@tonic-gate 	{'/', 'C', 0xA2},	/* 049 */	/* cent sign */
7540Sstevel@tonic-gate 	{'/', 'O', 0xD8},	/* 050 */	/* O with slash */
7550Sstevel@tonic-gate 	{'/', 'c', 0xA2},	/* 051 */	/* cent sign */
7560Sstevel@tonic-gate 	{'/', 'o', 0xF8},	/* 052 */	/* o with slash */
7570Sstevel@tonic-gate 	{'/', 'u', 0xB5},	/* 053 */	/* mu */
7580Sstevel@tonic-gate 	{'0', 'X', 0xA4},	/* 054 */	/* currency symbol */
7590Sstevel@tonic-gate 	{'0', '^', 0xB0},	/* 055 */	/* degree */
7600Sstevel@tonic-gate 	{'0', 'x', 0xA4},	/* 056 */	/* currency symbol */
7610Sstevel@tonic-gate 	{'1', '2', 0xBD},	/* 057 */	/* 1/2 */
7620Sstevel@tonic-gate 	{'1', '4', 0xBC},	/* 058 */	/* 1/4 */
7630Sstevel@tonic-gate 	{'1', '^', 0xB9},	/* 059 */	/* superior '1' */
7640Sstevel@tonic-gate 	{'2', '^', 0xB2},	/* 060 */	/* superior '2' */
7650Sstevel@tonic-gate 	{'3', '4', 0xBE},	/* 061 */	/* 3/4 */
7660Sstevel@tonic-gate 	{'3', '^', 0xB3},	/* 062 */	/* superior '3' */
7670Sstevel@tonic-gate 	{'<', '<', 0xAB},	/* 063 */	/* left guillemot */
7680Sstevel@tonic-gate 	{'>', '>', 0xBB},	/* 064 */	/* right guillemot */
7690Sstevel@tonic-gate 	{'?', '?', 0xBF},	/* 065 */	/* inverted ? */
7700Sstevel@tonic-gate 	{'A', 'E', 0xC6},	/* 066 */	/* AE dipthong */
7710Sstevel@tonic-gate 	{'A', '^', 0xC2},	/* 067 */	/* A with circumflex accent */
7720Sstevel@tonic-gate 	{'A', '`', 0xC0},	/* 068 */	/* A with grave accent */
7730Sstevel@tonic-gate 	{'A', '~', 0xC3},	/* 069 */	/* A with tilde */
7740Sstevel@tonic-gate 	{'C', 'O', 0xA9},	/* 060 */	/* copyright */
7750Sstevel@tonic-gate 	{'E', '^', 0xCA},	/* 071 */	/* E with circumflex accent */
7760Sstevel@tonic-gate 	{'E', '`', 0xC8},	/* 072 */	/* E with grave accent */
7770Sstevel@tonic-gate 	{'H', 'T', 0xDE},	/* 073 */	/* Upper-case thorn */
7780Sstevel@tonic-gate 	{'I', '^', 0xCE},	/* 074 */	/* I with circumflex accent */
7790Sstevel@tonic-gate 	{'I', '`', 0xCC},	/* 075 */	/* I with grave accent */
7800Sstevel@tonic-gate 	{'N', '~', 0xD1},	/* 076 */	/* N with tilde */
7810Sstevel@tonic-gate 	{'O', 'R', 0xAE},	/* 077 */	/* registered */
7820Sstevel@tonic-gate 	{'O', 'S', 0xA7},	/* 078 */	/* section mark */
7830Sstevel@tonic-gate 	{'O', 'X', 0xA4},	/* 079 */	/* currency symbol */
7840Sstevel@tonic-gate 	{'O', '^', 0xD4},	/* 080 */	/* O with circumflex accent */
7850Sstevel@tonic-gate 	{'O', '_', 0xBA},	/* 081 */	/* masculine superior numeral */
7860Sstevel@tonic-gate 	{'O', '`', 0xD2},	/* 082 */	/* O with grave accent */
7870Sstevel@tonic-gate 	{'O', '~', 0xD5},	/* 083 */	/* O with tilde */
7880Sstevel@tonic-gate 	{'P', '|', 0xDE},	/* 084 */	/* Upper-case thorn */
7890Sstevel@tonic-gate 	{'U', '^', 0xDB},	/* 085 */	/* U with circumflex accent */
7900Sstevel@tonic-gate 	{'U', '`', 0xD9},	/* 086 */	/* U with grave accent */
7910Sstevel@tonic-gate 	{'\\','\\',0xB4},	/* 087 */	/* acute accent */
7920Sstevel@tonic-gate 	{'^', 'a', 0xE2},	/* 088 */	/* a with circumflex accent */
7930Sstevel@tonic-gate 	{'^', 'e', 0xEA},	/* 089 */	/* e with circumflex accent */
7940Sstevel@tonic-gate 	{'^', 'i', 0xEE},	/* 090 */	/* i with circumflex accent */
7950Sstevel@tonic-gate 	{'^', 'o', 0xF4},	/* 091 */	/* o with circumflex accent */
7960Sstevel@tonic-gate 	{'^', 'u', 0xFB},	/* 092 */	/* u with circumflex accent */
7970Sstevel@tonic-gate 	{'_', 'o', 0xBA},	/* 093 */	/* masculine superior numeral */
7980Sstevel@tonic-gate 	{'`', 'a', 0xE0},	/* 094 */	/* a with grave accent */
7990Sstevel@tonic-gate 	{'`', 'e', 0xE8},	/* 095 */	/* e with grave accent */
8000Sstevel@tonic-gate 	{'`', 'i', 0xEC},	/* 096 */	/* i with grave accent */
8010Sstevel@tonic-gate 	{'`', 'o', 0xF2},	/* 097 */	/* o with grave accent */
8020Sstevel@tonic-gate 	{'`', 'u', 0xF9},	/* 098 */	/* u with grave accent */
8030Sstevel@tonic-gate 	{'a', 'e', 0xE6},	/* 099 */	/* ae dipthong */
8040Sstevel@tonic-gate 	{'a', '~', 0xE3},	/* 100 */	/* a with tilde */
8050Sstevel@tonic-gate 	{'c', 'o', 0xA9},	/* 101 */	/* copyright */
8060Sstevel@tonic-gate 	{'h', 't', 0xFE},	/* 102 */	/* Lower-case thorn */
8070Sstevel@tonic-gate 	{'n', '~', 0xF1},	/* 103 */	/* n with tilde */
8080Sstevel@tonic-gate 	{'o', 'r', 0xAE},	/* 104 */	/* registered */
8090Sstevel@tonic-gate 	{'o', 's', 0xA7},	/* 105 */	/* section mark */
8100Sstevel@tonic-gate 	{'o', 'x', 0xA4},	/* 106 */	/* currency symbol */
8110Sstevel@tonic-gate 	{'o', '~', 0xF5},	/* 107 */	/* o with tilde */
8120Sstevel@tonic-gate 	{'p', '|', 0xFE},	/* 108 */	/* Lower-case thorn */
8130Sstevel@tonic-gate 	{'s', 's', 0xDF},	/* 109 */	/* German double-s */
8140Sstevel@tonic-gate 	{'x', 'x', 0xD7},	/* 110 */	/* multiplication sign */
8150Sstevel@tonic-gate 	{'|', '|', 0xA6},	/* 111 */	/* broken bar */
8160Sstevel@tonic-gate 
8170Sstevel@tonic-gate 	{0, 0, 0},			/* end of table */
8180Sstevel@tonic-gate };
8190Sstevel@tonic-gate /* END CSTYLED */
8200Sstevel@tonic-gate 
8210Sstevel@tonic-gate /*
8220Sstevel@tonic-gate  * Floating Accent Sequence Table
8230Sstevel@tonic-gate  */
8240Sstevel@tonic-gate 
8250Sstevel@tonic-gate /* FA + ASCII character => ISO character */
8260Sstevel@tonic-gate struct fltaccent_sequence_t kb_fltaccent_table[] = {
8270Sstevel@tonic-gate 
8280Sstevel@tonic-gate 	{FA_UMLAUT, 'A', 0xC4},		/* A with umlaut */
8290Sstevel@tonic-gate 	{FA_UMLAUT, 'E', 0xCB},		/* E with umlaut */
8300Sstevel@tonic-gate 	{FA_UMLAUT, 'I', 0xCF},		/* I with umlaut */
8310Sstevel@tonic-gate 	{FA_UMLAUT, 'O', 0xD6},		/* O with umlaut */
8320Sstevel@tonic-gate 	{FA_UMLAUT, 'U', 0xDC},		/* U with umlaut */
8330Sstevel@tonic-gate 	{FA_UMLAUT, 'a', 0xE4},		/* a with umlaut */
8340Sstevel@tonic-gate 	{FA_UMLAUT, 'e', 0xEB},		/* e with umlaut */
8350Sstevel@tonic-gate 	{FA_UMLAUT, 'i', 0xEF},		/* i with umlaut */
8360Sstevel@tonic-gate 	{FA_UMLAUT, 'o', 0xF6},		/* o with umlaut */
8370Sstevel@tonic-gate 	{FA_UMLAUT, 'u', 0xFC},		/* u with umlaut */
8380Sstevel@tonic-gate 	{FA_UMLAUT, 'y', 0xFC},		/* y with umlaut */
8390Sstevel@tonic-gate 
8400Sstevel@tonic-gate 	{FA_CFLEX, 'A', 0xC2},		/* A with circumflex */
8410Sstevel@tonic-gate 	{FA_CFLEX, 'E', 0xCA},		/* E with circumflex */
8420Sstevel@tonic-gate 	{FA_CFLEX, 'I', 0xCE},		/* I with circumflex */
8430Sstevel@tonic-gate 	{FA_CFLEX, 'O', 0xD4},		/* O with circumflex */
8440Sstevel@tonic-gate 	{FA_CFLEX, 'U', 0xDB},		/* U with circumflex */
8450Sstevel@tonic-gate 	{FA_CFLEX, 'a', 0xE2},		/* a with circumflex */
8460Sstevel@tonic-gate 	{FA_CFLEX, 'e', 0xEA},		/* e with circumflex */
8470Sstevel@tonic-gate 	{FA_CFLEX, 'i', 0xEE},		/* i with circumflex */
8480Sstevel@tonic-gate 	{FA_CFLEX, 'o', 0xF4},		/* o with circumflex */
8490Sstevel@tonic-gate 	{FA_CFLEX, 'u', 0xFB},		/* u with circumflex */
8500Sstevel@tonic-gate 
8510Sstevel@tonic-gate 	{FA_TILDE, 'A', 0xC3},		/* A with tilde */
8520Sstevel@tonic-gate 	{FA_TILDE, 'N', 0xD1},		/* N with tilde */
8530Sstevel@tonic-gate 	{FA_TILDE, 'O', 0xD5},		/* O with tilde */
8540Sstevel@tonic-gate 	{FA_TILDE, 'a', 0xE3},		/* a with tilde */
8550Sstevel@tonic-gate 	{FA_TILDE, 'n', 0xF1},		/* n with tilde */
8560Sstevel@tonic-gate 	{FA_TILDE, 'o', 0xF5},		/* o with tilde */
8570Sstevel@tonic-gate 
8580Sstevel@tonic-gate 	{FA_CEDILLA, 'C', 0xC7},	/* C with cedilla */
8590Sstevel@tonic-gate 	{FA_CEDILLA, 'c', 0xE7},	/* c with cedilla */
8600Sstevel@tonic-gate 
8610Sstevel@tonic-gate 	{FA_ACUTE, 'A', 0xC1},		/* A with acute accent */
8620Sstevel@tonic-gate 	{FA_ACUTE, 'E', 0xC9},		/* E with acute accent */
8630Sstevel@tonic-gate 	{FA_ACUTE, 'I', 0xCD},		/* I with acute accent */
8640Sstevel@tonic-gate 	{FA_ACUTE, 'O', 0xD3},		/* O with acute accent */
8650Sstevel@tonic-gate 	{FA_ACUTE, 'U', 0xDA},		/* U with acute accent */
8660Sstevel@tonic-gate 	{FA_ACUTE, 'a', 0xE1},		/* a with acute accent */
8670Sstevel@tonic-gate 	{FA_ACUTE, 'e', 0xE9},		/* e with acute accent */
8680Sstevel@tonic-gate 	{FA_ACUTE, 'i', 0xED},		/* i with acute accent */
8690Sstevel@tonic-gate 	{FA_ACUTE, 'o', 0xF3},		/* o with acute accent */
8700Sstevel@tonic-gate 	{FA_ACUTE, 'u', 0xFA},		/* u with acute accent */
8710Sstevel@tonic-gate 	{FA_ACUTE, 'y', 0xFD},		/* y with acute accent */
8720Sstevel@tonic-gate 
8730Sstevel@tonic-gate 	{FA_GRAVE, 'A', 0xC0},		/* A with grave accent */
8740Sstevel@tonic-gate 	{FA_GRAVE, 'E', 0xC8},		/* E with grave accent */
8750Sstevel@tonic-gate 	{FA_GRAVE, 'I', 0xCC},		/* I with grave accent */
8760Sstevel@tonic-gate 	{FA_GRAVE, 'O', 0xD2},		/* O with grave accent */
8770Sstevel@tonic-gate 	{FA_GRAVE, 'U', 0xD9},		/* U with grave accent */
8780Sstevel@tonic-gate 	{FA_GRAVE, 'a', 0xE0},		/* a with grave accent */
8790Sstevel@tonic-gate 	{FA_GRAVE, 'e', 0xE8},		/* e with grave accent */
8800Sstevel@tonic-gate 	{FA_GRAVE, 'i', 0xEC},		/* i with grave accent */
8810Sstevel@tonic-gate 	{FA_GRAVE, 'o', 0xF2},		/* o with grave accent */
8820Sstevel@tonic-gate 	{FA_GRAVE, 'u', 0xF9},		/* u with grave accent */
8830Sstevel@tonic-gate 
8840Sstevel@tonic-gate 	{0, 0, 0},			/* end of table */
8850Sstevel@tonic-gate };
8860Sstevel@tonic-gate 
8870Sstevel@tonic-gate /*
8880Sstevel@tonic-gate  * Num Lock Table
8890Sstevel@tonic-gate  */
8900Sstevel@tonic-gate 
8910Sstevel@tonic-gate /* Num Lock:  pad key entry & 0x1F => ASCII character */
8920Sstevel@tonic-gate uchar_t kb_numlock_table[] = {
8930Sstevel@tonic-gate 	'=',
8940Sstevel@tonic-gate 	'/',
8950Sstevel@tonic-gate 	'*',
8960Sstevel@tonic-gate 	'-',
8970Sstevel@tonic-gate 	',',
8980Sstevel@tonic-gate 
8990Sstevel@tonic-gate 	'7',
9000Sstevel@tonic-gate 	'8',
9010Sstevel@tonic-gate 	'9',
9020Sstevel@tonic-gate 	'+',
9030Sstevel@tonic-gate 
9040Sstevel@tonic-gate 	'4',
9050Sstevel@tonic-gate 	'5',
9060Sstevel@tonic-gate 	'6',
9070Sstevel@tonic-gate 
9080Sstevel@tonic-gate 	'1',
9090Sstevel@tonic-gate 	'2',
9100Sstevel@tonic-gate 	'3',
9110Sstevel@tonic-gate 
9120Sstevel@tonic-gate 	'0',
9130Sstevel@tonic-gate 	'.',
9140Sstevel@tonic-gate 	'\n',	/* Enter */
9150Sstevel@tonic-gate };
916