usb_keytables.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* This module contains the translation tables for the up-down encoded
* USB keyboards.
*/
#define KEYMAP_SIZE_VARIABLE
/* handy way to define control characters in the tables */
#define c(char)(char&0x1F)
#define ESC 0x1B
#define DEL 0x7F
/* Unshifted keyboard table for USB keyboard */
/* 8 */ 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
/* 16 */ 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
/* 24 */ 'u', 'v', 'w', 'x', 'y', 'z', '1', '2',
/* 32 */ '3', '4', '5', '6', '7', '8', '9', '0',
};
/* Shifted keyboard table for USB keyboard */
/* 8 */ 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
/* 16 */ 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
/* 24 */ 'U', 'V', 'W', 'X', 'Y', 'Z', '!', '@',
/* 32 */ '#', '$', '%', '^', '&', '*', '(', ')',
};
/* Caps Locked keyboard table for USB keyboard */
/* 8 */ 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
/* 16 */ 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
/* 24 */ 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2',
/* 32 */ '3', '4', '5', '6', '7', '8', '9', '0',
};
/* Alt Graph keyboard table for USB keyboard */
};
/* Num Locked keyboard table for USB keyboard */
};
/* Controlled keyboard table for USB keyboard */
/* 8 */ c('e'), c('f'), c('g'), c('h'), c('i'), c('j'), c('k'), c('l'),
/* 16 */ c('m'), c('n'), c('o'), c('p'), c('q'), c('r'), c('s'), c('t'),
/* 24 */ c('u'), c('v'), c('w'), c('x'), c('y'), c('z'), '1', c(' '),
/* 32 */ '3', '4', '5', c('^'), '7', '8', '9', '0',
',', '.',
};
/* "Key Up" keyboard table for USB keyboard */
};
/*
* Index into keytab_pc_lc based on USB scancodes
*/
/* 0 */ 0, 0, 0, 0, 31, 50, 48, 33,
/* 8 */ 19, 34, 35, 36, 24, 37, 38, 39,
/* 16 */ 52, 51, 25, 26, 17, 20, 32, 21,
/* 24 */ 23, 49, 18, 47, 22, 46, 2, 3,
/* 32 */ 4, 5, 6, 7, 8, 9, 10, 11,
/* 40 */ 43, 110, 15, 16, 61, 12, 13, 27,
/* 48 */ 28, 29, 0, 40, 41, 1, 53, 54,
/* 56 */ 55, 30, 112, 113, 114, 115, 116, 117,
/* 64 */ 118, 119, 120, 121, 122, 123, 124, 125,
/* 72 */ 126, 75, 80, 85, 76, 81, 86, 89,
/* 80 */ 79, 84, 83, 90, 95, 100, 105, 106,
/* 88 */ 108, 93, 98, 103, 92, 97, 102, 91,
/* 96 */ 96, 101, 99, 104, 0, 0, 0, 0,
/* 104 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 112 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 120 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 128 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 136 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 144 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 152 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 160 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 168 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 176 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 184 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 192 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 200 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 208 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 216 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 224 */ 58, 44, 60, 0, 64, 57, 62, 0,
/* 232 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 240 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 248 */ 0, 0, 0, 0, 0, 0, 0
};
/* Index to keymaps for USB keyboard */
static struct keyboard kbtrans_usb_keyindex = {
0x0000, /* Shift bits which stay on with idle keyboard */
0x0000, /* Bucky bits which stay on with idle keyboard */
120,
#if defined(__sparc)
0, /* no alternate abort key F1 on sparc */
#else
58, /* alternate abort key F1 */
#endif
4,
NULL, /* Exception table */
};
struct keyboard *
{
return (pkbd);
}
void
{
}
/*
* Translate USB scancodes to PC scancodes before sending it to 'kbtrans'
*/
{
return (keytab_usb2pc[key]);
}