bsd_KbdMap.c revision ac15d2bc
1ee3138f1Smrg/* $XFree86$ */ 2ee3138f1Smrg 3ee3138f1Smrg/* 4ee3138f1Smrg * Slightly modified xf86KbdBSD.c which is 5ee3138f1Smrg * 6ee3138f1Smrg * Derived from xf86Kbd.c by S_ren Schmidt (sos@login.dkuug.dk) 7ee3138f1Smrg * which is Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. 8ee3138f1Smrg * and from xf86KbdCODrv.c by Holger Veit 9ee3138f1Smrg */ 10ee3138f1Smrg 11ee3138f1Smrg#ifdef HAVE_CONFIG_H 12ee3138f1Smrg#include "config.h" 13ee3138f1Smrg#endif 14ee3138f1Smrg 15ee3138f1Smrg#include <X11/X.h> 16ee3138f1Smrg#include <X11/Xmd.h> 17ee3138f1Smrg#include "input.h" 18ee3138f1Smrg#include "scrnintstr.h" 19ee3138f1Smrg 20ee3138f1Smrg#include "compiler.h" 21ee3138f1Smrg 22ee3138f1Smrg#include "xf86.h" 23ee3138f1Smrg#include "xf86Priv.h" 24ee3138f1Smrg#include "xf86_OSlib.h" 25ee3138f1Smrg#include "xf86Xinput.h" 26ee3138f1Smrg#include "xf86OSKbd.h" 27ee3138f1Smrg#include "atKeynames.h" 28ee3138f1Smrg#include "xf86Keymap.h" 29ee3138f1Smrg#include "bsd_kbd.h" 30ee3138f1Smrg 31ee3138f1Smrg#if (defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT)) && defined(GIO_KEYMAP) 32ee3138f1Smrg#define KD_GET_ENTRY(i,n) \ 33ee3138f1Smrg eascii_to_x[((keymap.key[i].spcl << (n+1)) & 0x100) + keymap.key[i].map[n]] 34ee3138f1Smrg 35ee3138f1Smrgstatic unsigned char remap[NUM_KEYCODES] = { 36ee3138f1Smrg 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 - 0x07 */ 37ee3138f1Smrg 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08 - 0x0f */ 38ee3138f1Smrg 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 - 0x17 */ 39ee3138f1Smrg 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18 - 0x1f */ 40ee3138f1Smrg 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 - 0x27 */ 41ee3138f1Smrg 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28 - 0x2f */ 42ee3138f1Smrg 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0, /* 0x30 - 0x37 */ 43ee3138f1Smrg 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38 - 0x3f */ 44ee3138f1Smrg 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0, /* 0x40 - 0x47 */ 45ee3138f1Smrg 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4f */ 46ee3138f1Smrg 0, 0, 0, 0, 0, 0, 0x56, 0x57, /* 0x50 - 0x57 */ 47ee3138f1Smrg 0x58, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5f */ 48ee3138f1Smrg 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x67 */ 49ee3138f1Smrg 0, 0, 0, 0, 0, 0, 0, 0, /* 0x68 - 0x6f */ 50ee3138f1Smrg 0, 0, 0x69, 0x65, 0, 0, 0, 0, /* 0x70 - 0x77 */ 51ee3138f1Smrg 0, 0, 0, 0, 0, 0, 0, 0, /* 0x78 - 0x7f */ 52ee3138f1Smrg}; 53ee3138f1Smrg 54ee3138f1Smrg/* This table assumes the ibm code page 437 coding for characters 55ee3138f1Smrg * > 0x80. They are returned in this form by PCVT */ 56ee3138f1Smrgstatic KeySym eascii_to_x[512] = { 57ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 58ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 59ee3138f1Smrg XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol, 60ee3138f1Smrg NoSymbol, XK_Return, NoSymbol, NoSymbol, 61ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 62ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 63ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, XK_Escape, 64ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 65ee3138f1Smrg XK_space, XK_exclam, XK_quotedbl, XK_numbersign, 66ee3138f1Smrg XK_dollar, XK_percent, XK_ampersand, XK_apostrophe, 67ee3138f1Smrg XK_parenleft, XK_parenright, XK_asterisk, XK_plus, 68ee3138f1Smrg XK_comma, XK_minus, XK_period, XK_slash, 69ee3138f1Smrg XK_0, XK_1, XK_2, XK_3, 70ee3138f1Smrg XK_4, XK_5, XK_6, XK_7, 71ee3138f1Smrg XK_8, XK_9, XK_colon, XK_semicolon, 72ee3138f1Smrg XK_less, XK_equal, XK_greater, XK_question, 73ee3138f1Smrg XK_at, XK_A, XK_B, XK_C, 74ee3138f1Smrg XK_D, XK_E, XK_F, XK_G, 75ee3138f1Smrg XK_H, XK_I, XK_J, XK_K, 76ee3138f1Smrg XK_L, XK_M, XK_N, XK_O, 77ee3138f1Smrg XK_P, XK_Q, XK_R, XK_S, 78ee3138f1Smrg XK_T, XK_U, XK_V, XK_W, 79ee3138f1Smrg XK_X, XK_Y, XK_Z, XK_bracketleft, 80ee3138f1Smrg XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore, 81ee3138f1Smrg XK_grave, XK_a, XK_b, XK_c, 82ee3138f1Smrg XK_d, XK_e, XK_f, XK_g, 83ee3138f1Smrg XK_h, XK_i, XK_j, XK_k, 84ee3138f1Smrg XK_l, XK_m, XK_n, XK_o, 85ee3138f1Smrg XK_p, XK_q, XK_r, XK_s, 86ee3138f1Smrg XK_t, XK_u, XK_v, XK_w, 87ee3138f1Smrg XK_x, XK_y, XK_z, XK_braceleft, 88ee3138f1Smrg XK_bar, XK_braceright, XK_asciitilde, XK_Delete, 89ee3138f1Smrg XK_Ccedilla, XK_udiaeresis, XK_eacute, XK_acircumflex, 90ee3138f1Smrg XK_adiaeresis, XK_agrave, XK_aring, XK_ccedilla, 91ee3138f1Smrg XK_ecircumflex, XK_ediaeresis, XK_egrave, XK_idiaeresis, 92ee3138f1Smrg XK_icircumflex, XK_igrave, XK_Adiaeresis, XK_Aring, 93ee3138f1Smrg XK_Eacute, XK_ae, XK_AE, XK_ocircumflex, 94ee3138f1Smrg XK_odiaeresis, XK_ograve, XK_ucircumflex, XK_ugrave, 95ee3138f1Smrg XK_ydiaeresis, XK_Odiaeresis, XK_Udiaeresis, XK_cent, 96ee3138f1Smrg XK_sterling, XK_yen, XK_paragraph, XK_section, 97ee3138f1Smrg XK_aacute, XK_iacute, XK_oacute, XK_uacute, 98ee3138f1Smrg XK_ntilde, XK_Ntilde, XK_ordfeminine, XK_masculine, 99ee3138f1Smrg XK_questiondown,XK_hyphen, XK_notsign, XK_onehalf, 100ee3138f1Smrg XK_onequarter, XK_exclamdown, XK_guillemotleft,XK_guillemotright, 101ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 102ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 103ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 104ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 105ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 106ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 107ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 108ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 109ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 110ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 111ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 112ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 113ee3138f1Smrg XK_Greek_alpha, XK_ssharp, XK_Greek_GAMMA, XK_Greek_pi, 114ee3138f1Smrg XK_Greek_SIGMA, XK_Greek_sigma, XK_mu, XK_Greek_tau, 115ee3138f1Smrg XK_Greek_PHI, XK_Greek_THETA, XK_Greek_OMEGA, XK_Greek_delta, 116ee3138f1Smrg XK_infinity, XK_Ooblique, XK_Greek_epsilon, XK_intersection, 117ee3138f1Smrg XK_identical, XK_plusminus, XK_greaterthanequal, XK_lessthanequal, 118ee3138f1Smrg XK_topintegral, XK_botintegral, XK_division, XK_similarequal, 119ee3138f1Smrg XK_degree, NoSymbol, NoSymbol, XK_radical, 120ee3138f1Smrg XK_Greek_eta, XK_twosuperior, XK_periodcentered, NoSymbol, 121ee3138f1Smrg 122ee3138f1Smrg /* 123ee3138f1Smrg * special marked entries (256 + x) 124ee3138f1Smrg */ 125ee3138f1Smrg 126ee3138f1Smrg /* This has been checked against what syscons actually does */ 127ee3138f1Smrg NoSymbol, NoSymbol, XK_Shift_L, XK_Shift_R, 128ee3138f1Smrg XK_Caps_Lock, XK_Num_Lock, XK_Scroll_Lock, XK_Alt_L, 129ee3138f1Smrg XK_ISO_Left_Tab,XK_Control_L, NoSymbol, NoSymbol, 130ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 131ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 132ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 133ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, XK_F1, 134ee3138f1Smrg XK_F2, XK_F3, XK_F4, XK_F5, 135ee3138f1Smrg XK_F6, XK_F7, XK_F8, XK_F9, 136ee3138f1Smrg XK_F10, XK_F11, XK_F12, NoSymbol, 137ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 138ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 139ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 140ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 141ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 142ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 143ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 144ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 145ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 146ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 147ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 148ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 149ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 150ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 151ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 152ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 153ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 154ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 155ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 156ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 157ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 158ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 159ee3138f1Smrg XK_Control_R, XK_Alt_R, NoSymbol, NoSymbol, 160ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 161ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 162ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 163ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 164ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 165ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 166ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 167ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 168ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 169ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 170ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 171ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 172ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 173ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 174ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 175ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 176ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 177ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 178ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 179ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 180ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 181ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 182ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 183ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 184ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 185ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 186ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 187ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 188ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 189ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 190ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol 191ee3138f1Smrg}; 192ee3138f1Smrg 193ee3138f1Smrg#ifdef __OpenBSD__ 194ee3138f1Smrg/* don't mark AltR and CtrlR for remapping, since they 195ee3138f1Smrg * cannot be remapped by pccons */ 196ee3138f1Smrgstatic unsigned char pccons_remap[128] = { 197ee3138f1Smrg 0, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00 - 0x07 */ 198ee3138f1Smrg 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08 - 0x0f */ 199ee3138f1Smrg 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10 - 0x17 */ 200ee3138f1Smrg 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, /* 0x18 - 0x1f */ 201ee3138f1Smrg 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, /* 0x20 - 0x27 */ 202ee3138f1Smrg 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, /* 0x28 - 0x2f */ 203ee3138f1Smrg 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0, /* 0x30 - 0x37 */ 204ee3138f1Smrg 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, /* 0x38 - 0x3f */ 205ee3138f1Smrg 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0, /* 0x40 - 0x47 */ 206ee3138f1Smrg 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4f */ 207ee3138f1Smrg 0, 0, 0, 0, 0, 0, 0x56, 0x57, /* 0x50 - 0x57 */ 208ee3138f1Smrg 0x58, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5f */ 209ee3138f1Smrg 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x67 */ 210ee3138f1Smrg 0, 0, 0, 0, 0, 0, 0, 0, /* 0x68 - 0x6f */ 211ee3138f1Smrg 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70 - 0x77 */ 212ee3138f1Smrg 0, 0, 0, 0, 0, 0, 0, 0, /* 0x78 - 0x7f */ 213ee3138f1Smrg}; 214ee3138f1Smrg 215ee3138f1Smrg/* This table assumes an iso8859_1 encoding for the characters 216ee3138f1Smrg * > 80, as returned by pccons */ 217ee3138f1Smrgstatic KeySym latin1_to_x[256] = { 218ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 219ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 220ee3138f1Smrg XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol, 221ee3138f1Smrg NoSymbol, XK_Return, NoSymbol, NoSymbol, 222ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 223ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 224ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, XK_Escape, 225ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 226ee3138f1Smrg XK_space, XK_exclam, XK_quotedbl, XK_numbersign, 227ee3138f1Smrg XK_dollar, XK_percent, XK_ampersand, XK_apostrophe, 228ee3138f1Smrg XK_parenleft, XK_parenright, XK_asterisk, XK_plus, 229ee3138f1Smrg XK_comma, XK_minus, XK_period, XK_slash, 230ee3138f1Smrg XK_0, XK_1, XK_2, XK_3, 231ee3138f1Smrg XK_4, XK_5, XK_6, XK_7, 232ee3138f1Smrg XK_8, XK_9, XK_colon, XK_semicolon, 233ee3138f1Smrg XK_less, XK_equal, XK_greater, XK_question, 234ee3138f1Smrg XK_at, XK_A, XK_B, XK_C, 235ee3138f1Smrg XK_D, XK_E, XK_F, XK_G, 236ee3138f1Smrg XK_H, XK_I, XK_J, XK_K, 237ee3138f1Smrg XK_L, XK_M, XK_N, XK_O, 238ee3138f1Smrg XK_P, XK_Q, XK_R, XK_S, 239ee3138f1Smrg XK_T, XK_U, XK_V, XK_W, 240ee3138f1Smrg XK_X, XK_Y, XK_Z, XK_bracketleft, 241ee3138f1Smrg XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore, 242ee3138f1Smrg XK_grave, XK_a, XK_b, XK_c, 243ee3138f1Smrg XK_d, XK_e, XK_f, XK_g, 244ee3138f1Smrg XK_h, XK_i, XK_j, XK_k, 245ee3138f1Smrg XK_l, XK_m, XK_n, XK_o, 246ee3138f1Smrg XK_p, XK_q, XK_r, XK_s, 247ee3138f1Smrg XK_t, XK_u, XK_v, XK_w, 248ee3138f1Smrg XK_x, XK_y, XK_z, XK_braceleft, 249ee3138f1Smrg XK_bar, XK_braceright, XK_asciitilde, XK_Delete, 250ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 251ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 252ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 253ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 254ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 255ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 256ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 257ee3138f1Smrg NoSymbol, NoSymbol, NoSymbol, NoSymbol, 258ee3138f1Smrg XK_nobreakspace,XK_exclamdown, XK_cent, XK_sterling, 259ee3138f1Smrg XK_currency, XK_yen, XK_brokenbar, XK_section, 260ee3138f1Smrg XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft, 261ee3138f1Smrg XK_notsign, XK_hyphen, XK_registered, XK_macron, 262ee3138f1Smrg XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior, 263ee3138f1Smrg XK_acute, XK_mu, XK_paragraph, XK_periodcentered, 264ee3138f1Smrg XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright, 265ee3138f1Smrg XK_onequarter, XK_onehalf, XK_threequarters,XK_questiondown, 266ee3138f1Smrg XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde, 267ee3138f1Smrg XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla, 268ee3138f1Smrg XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis, 269ee3138f1Smrg XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis, 270ee3138f1Smrg XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute, 271ee3138f1Smrg XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply, 272ee3138f1Smrg XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex, 273ee3138f1Smrg XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp, 274ee3138f1Smrg XK_agrave, XK_aacute, XK_acircumflex, XK_atilde, 275ee3138f1Smrg XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla, 276ee3138f1Smrg XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis, 277ee3138f1Smrg XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis, 278ee3138f1Smrg XK_eth, XK_ntilde, XK_ograve, XK_oacute, 279ee3138f1Smrg XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division, 280ee3138f1Smrg XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex, 281ee3138f1Smrg XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis 282ee3138f1Smrg }; 283ee3138f1Smrg#endif 284ee3138f1Smrg 285ee3138f1Smrg#ifdef SYSCONS_SUPPORT 286ee3138f1Smrgstatic 287ee3138f1Smrgunsigned char sysconsCODEMap[] = { 288ee3138f1Smrg KEY_KP_Enter, KEY_RCtrl, KEY_KP_Divide, KEY_Print, 289ee3138f1Smrg KEY_AltLang, KEY_KP_7, KEY_KP_8, KEY_KP_9, 290ee3138f1Smrg KEY_KP_4, KEY_KP_6, KEY_KP_1, KEY_KP_2, 291ee3138f1Smrg KEY_KP_3, KEY_KP_0, KEY_KP_Decimal, KEY_Pause, 292ee3138f1Smrg KEY_LMeta, KEY_RMeta, KEY_Menu, KEY_Break 293ee3138f1Smrg}; 294ee3138f1Smrgstatic 295ee3138f1SmrgTransMapRec sysconsCODE = { 296ee3138f1Smrg 0x59, 297ee3138f1Smrg 0x6d, 298ee3138f1Smrg sysconsCODEMap 299ee3138f1Smrg}; 300ee3138f1Smrg#endif 301ee3138f1Smrg#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ 302ee3138f1Smrg 303ee3138f1Smrg#ifdef WSCONS_SUPPORT 304ee3138f1Smrg 305ee3138f1Smrgstatic CARD8 wsUsbMap[] = { 306ee3138f1Smrg /* 0 */ KEY_NOTUSED, 307ee3138f1Smrg /* 1 */ KEY_NOTUSED, 308ee3138f1Smrg /* 2 */ KEY_NOTUSED, 309ee3138f1Smrg /* 3 */ KEY_NOTUSED, 310ee3138f1Smrg /* 4 */ KEY_A, 311ee3138f1Smrg /* 5 */ KEY_B, 312ee3138f1Smrg /* 6 */ KEY_C, 313ee3138f1Smrg /* 7 */ KEY_D, 314ee3138f1Smrg /* 8 */ KEY_E, 315ee3138f1Smrg /* 9 */ KEY_F, 316ee3138f1Smrg /* 10 */ KEY_G, 317ee3138f1Smrg /* 11 */ KEY_H, 318ee3138f1Smrg /* 12 */ KEY_I, 319ee3138f1Smrg /* 13 */ KEY_J, 320ee3138f1Smrg /* 14 */ KEY_K, 321ee3138f1Smrg /* 15 */ KEY_L, 322ee3138f1Smrg /* 16 */ KEY_M, 323ee3138f1Smrg /* 17 */ KEY_N, 324ee3138f1Smrg /* 18 */ KEY_O, 325ee3138f1Smrg /* 19 */ KEY_P, 326ee3138f1Smrg /* 20 */ KEY_Q, 327ee3138f1Smrg /* 21 */ KEY_R, 328ee3138f1Smrg /* 22 */ KEY_S, 329ee3138f1Smrg /* 23 */ KEY_T, 330ee3138f1Smrg /* 24 */ KEY_U, 331ee3138f1Smrg /* 25 */ KEY_V, 332ee3138f1Smrg /* 26 */ KEY_W, 333ee3138f1Smrg /* 27 */ KEY_X, 334ee3138f1Smrg /* 28 */ KEY_Y, 335ee3138f1Smrg /* 29 */ KEY_Z, 336ee3138f1Smrg /* 30 */ KEY_1, /* 1 !*/ 337ee3138f1Smrg /* 31 */ KEY_2, /* 2 @ */ 338ee3138f1Smrg /* 32 */ KEY_3, /* 3 # */ 339ee3138f1Smrg /* 33 */ KEY_4, /* 4 $ */ 340ee3138f1Smrg /* 34 */ KEY_5, /* 5 % */ 341ee3138f1Smrg /* 35 */ KEY_6, /* 6 ^ */ 342ee3138f1Smrg /* 36 */ KEY_7, /* 7 & */ 343ee3138f1Smrg /* 37 */ KEY_8, /* 8 * */ 344ee3138f1Smrg /* 38 */ KEY_9, /* 9 ( */ 345ee3138f1Smrg /* 39 */ KEY_0, /* 0 ) */ 346ee3138f1Smrg /* 40 */ KEY_Enter, /* Return */ 347ee3138f1Smrg /* 41 */ KEY_Escape, /* Escape */ 348ee3138f1Smrg /* 42 */ KEY_BackSpace, /* Backspace Delete */ 349ee3138f1Smrg /* 43 */ KEY_Tab, /* Tab */ 350ee3138f1Smrg /* 44 */ KEY_Space, /* Space */ 351ee3138f1Smrg /* 45 */ KEY_Minus, /* - _ */ 352ee3138f1Smrg /* 46 */ KEY_Equal, /* = + */ 353ee3138f1Smrg /* 47 */ KEY_LBrace, /* [ { */ 354ee3138f1Smrg /* 48 */ KEY_RBrace, /* ] } */ 355ee3138f1Smrg /* 49 */ KEY_BSlash, /* \ | */ 356ee3138f1Smrg /* 50 */ KEY_BSlash2, /* \ _ # ~ on some keyboards */ 357ee3138f1Smrg /* 51 */ KEY_SemiColon, /* ; : */ 358ee3138f1Smrg /* 52 */ KEY_Quote, /* ' " */ 359ee3138f1Smrg /* 53 */ KEY_Tilde, /* ` ~ */ 360ee3138f1Smrg /* 54 */ KEY_Comma, /* , < */ 361ee3138f1Smrg /* 55 */ KEY_Period, /* . > */ 362ee3138f1Smrg /* 56 */ KEY_Slash, /* / ? */ 363ee3138f1Smrg /* 57 */ KEY_CapsLock, /* Caps Lock */ 364ee3138f1Smrg /* 58 */ KEY_F1, /* F1 */ 365ee3138f1Smrg /* 59 */ KEY_F2, /* F2 */ 366ee3138f1Smrg /* 60 */ KEY_F3, /* F3 */ 367ee3138f1Smrg /* 61 */ KEY_F4, /* F4 */ 368ee3138f1Smrg /* 62 */ KEY_F5, /* F5 */ 369ee3138f1Smrg /* 63 */ KEY_F6, /* F6 */ 370ee3138f1Smrg /* 64 */ KEY_F7, /* F7 */ 371ee3138f1Smrg /* 65 */ KEY_F8, /* F8 */ 372ee3138f1Smrg /* 66 */ KEY_F9, /* F9 */ 373ee3138f1Smrg /* 67 */ KEY_F10, /* F10 */ 374ee3138f1Smrg /* 68 */ KEY_F11, /* F11 */ 375ee3138f1Smrg /* 69 */ KEY_F12, /* F12 */ 376ee3138f1Smrg /* 70 */ KEY_Print, /* PrintScrn SysReq */ 377ee3138f1Smrg /* 71 */ KEY_ScrollLock, /* Scroll Lock */ 378ee3138f1Smrg /* 72 */ KEY_Pause, /* Pause Break */ 379ee3138f1Smrg /* 73 */ KEY_Insert, /* Insert XXX Help on some Mac Keyboards */ 380ee3138f1Smrg /* 74 */ KEY_Home, /* Home */ 381ee3138f1Smrg /* 75 */ KEY_PgUp, /* Page Up */ 382ee3138f1Smrg /* 76 */ KEY_Delete, /* Delete */ 383ee3138f1Smrg /* 77 */ KEY_End, /* End */ 384ee3138f1Smrg /* 78 */ KEY_PgDown, /* Page Down */ 385ee3138f1Smrg /* 79 */ KEY_Right, /* Right Arrow */ 386ee3138f1Smrg /* 80 */ KEY_Left, /* Left Arrow */ 387ee3138f1Smrg /* 81 */ KEY_Down, /* Down Arrow */ 388ee3138f1Smrg /* 82 */ KEY_Up, /* Up Arrow */ 389ee3138f1Smrg /* 83 */ KEY_NumLock, /* Num Lock */ 390ee3138f1Smrg /* 84 */ KEY_KP_Divide, /* Keypad / */ 391ee3138f1Smrg /* 85 */ KEY_KP_Multiply, /* Keypad * */ 392ee3138f1Smrg /* 86 */ KEY_KP_Minus, /* Keypad - */ 393ee3138f1Smrg /* 87 */ KEY_KP_Plus, /* Keypad + */ 394ee3138f1Smrg /* 88 */ KEY_KP_Enter, /* Keypad Enter */ 395ee3138f1Smrg /* 89 */ KEY_KP_1, /* Keypad 1 End */ 396ee3138f1Smrg /* 90 */ KEY_KP_2, /* Keypad 2 Down */ 397ee3138f1Smrg /* 91 */ KEY_KP_3, /* Keypad 3 Pg Down */ 398ee3138f1Smrg /* 92 */ KEY_KP_4, /* Keypad 4 Left */ 399ee3138f1Smrg /* 93 */ KEY_KP_5, /* Keypad 5 */ 400ee3138f1Smrg /* 94 */ KEY_KP_6, /* Keypad 6 */ 401ee3138f1Smrg /* 95 */ KEY_KP_7, /* Keypad 7 Home */ 402ee3138f1Smrg /* 96 */ KEY_KP_8, /* Keypad 8 Up */ 403ee3138f1Smrg /* 97 */ KEY_KP_9, /* KEypad 9 Pg Up */ 404ee3138f1Smrg /* 98 */ KEY_KP_0, /* Keypad 0 Ins */ 405ee3138f1Smrg /* 99 */ KEY_KP_Decimal, /* Keypad . Del */ 406ee3138f1Smrg /* 100 */ KEY_Less, /* < > on some keyboards */ 407ee3138f1Smrg /* 101 */ KEY_Menu, /* Menu */ 408ee3138f1Smrg /* 102 */ KEY_NOTUSED, 409ee3138f1Smrg /* 103 */ KEY_KP_Equal, /* Keypad = on Mac keyboards */ 410ee3138f1Smrg /* 104 */ KEY_NOTUSED, 411ee3138f1Smrg /* 105 */ KEY_NOTUSED, 412ee3138f1Smrg /* 106 */ KEY_NOTUSED, 413ee3138f1Smrg /* 107 */ KEY_NOTUSED, 414ee3138f1Smrg /* 108 */ KEY_NOTUSED, 415ee3138f1Smrg /* 109 */ KEY_NOTUSED, 416ee3138f1Smrg /* 110 */ KEY_NOTUSED, 417ee3138f1Smrg /* 111 */ KEY_NOTUSED, 418ee3138f1Smrg /* 112 */ KEY_NOTUSED, 419ee3138f1Smrg /* 113 */ KEY_NOTUSED, 420ee3138f1Smrg /* 114 */ KEY_NOTUSED, 421ee3138f1Smrg /* 115 */ KEY_NOTUSED, 422ee3138f1Smrg /* 116 */ KEY_NOTUSED, 423ee3138f1Smrg /* 117 */ KEY_NOTUSED, 424ee3138f1Smrg /* 118 */ KEY_NOTUSED, 425ee3138f1Smrg /* 119 */ KEY_NOTUSED, 426ee3138f1Smrg /* 120 */ KEY_NOTUSED, 427ee3138f1Smrg /* 121 */ KEY_NOTUSED, 428ee3138f1Smrg /* 122 */ KEY_NOTUSED, 429ee3138f1Smrg /* 123 */ KEY_NOTUSED, 430ee3138f1Smrg /* 124 */ KEY_NOTUSED, 431ee3138f1Smrg /* 125 */ KEY_NOTUSED, 432ee3138f1Smrg /* 126 */ KEY_NOTUSED, 433ee3138f1Smrg /* 127 */ KEY_NOTUSED, 434ee3138f1Smrg /* 128 */ KEY_NOTUSED, 435ee3138f1Smrg /* 129 */ KEY_NOTUSED, 436ee3138f1Smrg /* 130 */ KEY_NOTUSED, 437ee3138f1Smrg /* 131 */ KEY_NOTUSED, 438ee3138f1Smrg /* 132 */ KEY_NOTUSED, 439ee3138f1Smrg /* 133 */ KEY_NOTUSED, 440ee3138f1Smrg /* 134 */ KEY_NOTUSED, 441ee3138f1Smrg /* 135 */ KEY_NOTUSED, 442ee3138f1Smrg /* 136 */ KEY_NOTUSED, 443ee3138f1Smrg /* 137 */ KEY_NOTUSED, 444ee3138f1Smrg /* 138 */ KEY_NOTUSED, 445ee3138f1Smrg /* 139 */ KEY_NOTUSED, 446ee3138f1Smrg /* 140 */ KEY_NOTUSED, 447ee3138f1Smrg /* 141 */ KEY_NOTUSED, 448ee3138f1Smrg /* 142 */ KEY_NOTUSED, 449ee3138f1Smrg /* 143 */ KEY_NOTUSED, 450ee3138f1Smrg /* 144 */ KEY_NOTUSED, 451ee3138f1Smrg /* 145 */ KEY_NOTUSED, 452ee3138f1Smrg /* 146 */ KEY_NOTUSED, 453ee3138f1Smrg /* 147 */ KEY_NOTUSED, 454ee3138f1Smrg /* 148 */ KEY_NOTUSED, 455ee3138f1Smrg /* 149 */ KEY_NOTUSED, 456ee3138f1Smrg /* 150 */ KEY_NOTUSED, 457ee3138f1Smrg /* 151 */ KEY_NOTUSED, 458ee3138f1Smrg /* 152 */ KEY_NOTUSED, 459ee3138f1Smrg /* 153 */ KEY_NOTUSED, 460ee3138f1Smrg /* 154 */ KEY_NOTUSED, 461ee3138f1Smrg /* 155 */ KEY_NOTUSED, 462ee3138f1Smrg /* 156 */ KEY_NOTUSED, 463ee3138f1Smrg /* 157 */ KEY_NOTUSED, 464ee3138f1Smrg /* 158 */ KEY_NOTUSED, 465ee3138f1Smrg /* 159 */ KEY_NOTUSED, 466ee3138f1Smrg /* 160 */ KEY_NOTUSED, 467ee3138f1Smrg /* 161 */ KEY_NOTUSED, 468ee3138f1Smrg /* 162 */ KEY_NOTUSED, 469ee3138f1Smrg /* 163 */ KEY_NOTUSED, 470ee3138f1Smrg /* 164 */ KEY_NOTUSED, 471ee3138f1Smrg /* 165 */ KEY_NOTUSED, 472ee3138f1Smrg /* 166 */ KEY_NOTUSED, 473ee3138f1Smrg /* 167 */ KEY_NOTUSED, 474ee3138f1Smrg /* 168 */ KEY_NOTUSED, 475ee3138f1Smrg /* 169 */ KEY_NOTUSED, 476ee3138f1Smrg /* 170 */ KEY_NOTUSED, 477ee3138f1Smrg /* 171 */ KEY_NOTUSED, 478ee3138f1Smrg /* 172 */ KEY_NOTUSED, 479ee3138f1Smrg /* 173 */ KEY_NOTUSED, 480ee3138f1Smrg /* 174 */ KEY_NOTUSED, 481ee3138f1Smrg /* 175 */ KEY_NOTUSED, 482ee3138f1Smrg /* 176 */ KEY_NOTUSED, 483ee3138f1Smrg /* 177 */ KEY_NOTUSED, 484ee3138f1Smrg /* 178 */ KEY_NOTUSED, 485ee3138f1Smrg /* 179 */ KEY_NOTUSED, 486ee3138f1Smrg /* 180 */ KEY_NOTUSED, 487ee3138f1Smrg /* 181 */ KEY_NOTUSED, 488ee3138f1Smrg /* 182 */ KEY_NOTUSED, 489ee3138f1Smrg /* 183 */ KEY_NOTUSED, 490ee3138f1Smrg /* 184 */ KEY_NOTUSED, 491ee3138f1Smrg /* 185 */ KEY_NOTUSED, 492ee3138f1Smrg /* 186 */ KEY_NOTUSED, 493ee3138f1Smrg /* 187 */ KEY_NOTUSED, 494ee3138f1Smrg /* 188 */ KEY_NOTUSED, 495ee3138f1Smrg /* 189 */ KEY_NOTUSED, 496ee3138f1Smrg /* 190 */ KEY_NOTUSED, 497ee3138f1Smrg /* 191 */ KEY_NOTUSED, 498ee3138f1Smrg /* 192 */ KEY_NOTUSED, 499ee3138f1Smrg /* 193 */ KEY_NOTUSED, 500ee3138f1Smrg /* 194 */ KEY_NOTUSED, 501ee3138f1Smrg /* 195 */ KEY_NOTUSED, 502ee3138f1Smrg /* 196 */ KEY_NOTUSED, 503ee3138f1Smrg /* 197 */ KEY_NOTUSED, 504ee3138f1Smrg /* 198 */ KEY_NOTUSED, 505ee3138f1Smrg /* 199 */ KEY_NOTUSED, 506ee3138f1Smrg /* 200 */ KEY_NOTUSED, 507ee3138f1Smrg /* 201 */ KEY_NOTUSED, 508ee3138f1Smrg /* 202 */ KEY_NOTUSED, 509ee3138f1Smrg /* 203 */ KEY_NOTUSED, 510ee3138f1Smrg /* 204 */ KEY_NOTUSED, 511ee3138f1Smrg /* 205 */ KEY_NOTUSED, 512ee3138f1Smrg /* 206 */ KEY_NOTUSED, 513ee3138f1Smrg /* 207 */ KEY_NOTUSED, 514ee3138f1Smrg /* 208 */ KEY_NOTUSED, 515ee3138f1Smrg /* 209 */ KEY_NOTUSED, 516ee3138f1Smrg /* 210 */ KEY_NOTUSED, 517ee3138f1Smrg /* 211 */ KEY_NOTUSED, 518ee3138f1Smrg /* 212 */ KEY_NOTUSED, 519ee3138f1Smrg /* 213 */ KEY_NOTUSED, 520ee3138f1Smrg /* 214 */ KEY_NOTUSED, 521ee3138f1Smrg /* 215 */ KEY_NOTUSED, 522ee3138f1Smrg /* 216 */ KEY_NOTUSED, 523ee3138f1Smrg /* 217 */ KEY_NOTUSED, 524ee3138f1Smrg /* 218 */ KEY_NOTUSED, 525ee3138f1Smrg /* 219 */ KEY_NOTUSED, 526ee3138f1Smrg /* 220 */ KEY_NOTUSED, 527ee3138f1Smrg /* 221 */ KEY_NOTUSED, 528ee3138f1Smrg /* 222 */ KEY_NOTUSED, 529ee3138f1Smrg /* 223 */ KEY_NOTUSED, 530ee3138f1Smrg /* 224 */ KEY_LCtrl, /* Left Control */ 531ee3138f1Smrg /* 225 */ KEY_ShiftL, /* Left Shift */ 532ee3138f1Smrg /* 226 */ KEY_Alt, /* Left Alt */ 533ee3138f1Smrg /* 227 */ KEY_LMeta, /* Left Meta */ 534ee3138f1Smrg /* 228 */ KEY_RCtrl, /* Right Control */ 535ee3138f1Smrg /* 229 */ KEY_ShiftR, /* Right Shift */ 536ee3138f1Smrg /* 230 */ KEY_AltLang, /* Right Alt, AKA AltGr */ 537ee3138f1Smrg /* 231 */ KEY_LMeta, /* Right Meta XXX */ 538ee3138f1Smrg}; 539ee3138f1Smrg#define WS_USB_MAP_SIZE (sizeof(wsUsbMap)/sizeof(unsigned char)) 540ee3138f1Smrg 541ee3138f1Smrgstatic 542ee3138f1SmrgTransMapRec wsUsb = { 543ee3138f1Smrg 0, 544ee3138f1Smrg WS_USB_MAP_SIZE, 545ee3138f1Smrg wsUsbMap 546ee3138f1Smrg}; 547ee3138f1Smrg 548ac15d2bcSmacallanstatic CARD8 wsXtMap[] = { 549ac15d2bcSmacallan /* 0 */ KEY_NOTUSED, 550ac15d2bcSmacallan /* 1 */ KEY_Escape, 551ac15d2bcSmacallan /* 2 */ KEY_1, 552ac15d2bcSmacallan /* 3 */ KEY_2, 553ac15d2bcSmacallan /* 4 */ KEY_3, 554ac15d2bcSmacallan /* 5 */ KEY_4, 555ac15d2bcSmacallan /* 6 */ KEY_5, 556ac15d2bcSmacallan /* 7 */ KEY_6, 557ac15d2bcSmacallan /* 8 */ KEY_7, 558ac15d2bcSmacallan /* 9 */ KEY_8, 559ac15d2bcSmacallan /* 10 */ KEY_9, 560ac15d2bcSmacallan /* 11 */ KEY_0, 561ac15d2bcSmacallan /* 12 */ KEY_Minus, 562ac15d2bcSmacallan /* 13 */ KEY_Equal, 563ac15d2bcSmacallan /* 14 */ KEY_BackSpace, 564ac15d2bcSmacallan /* 15 */ KEY_Tab, 565ac15d2bcSmacallan /* 16 */ KEY_Q, 566ac15d2bcSmacallan /* 17 */ KEY_W, 567ac15d2bcSmacallan /* 18 */ KEY_E, 568ac15d2bcSmacallan /* 19 */ KEY_R, 569ac15d2bcSmacallan /* 20 */ KEY_T, 570ac15d2bcSmacallan /* 21 */ KEY_Y, 571ac15d2bcSmacallan /* 22 */ KEY_U, 572ac15d2bcSmacallan /* 23 */ KEY_I, 573ac15d2bcSmacallan /* 24 */ KEY_O, 574ac15d2bcSmacallan /* 25 */ KEY_P, 575ac15d2bcSmacallan /* 26 */ KEY_LBrace, 576ac15d2bcSmacallan /* 27 */ KEY_RBrace, 577ac15d2bcSmacallan /* 28 */ KEY_Enter, 578ac15d2bcSmacallan /* 29 */ KEY_LCtrl, 579ac15d2bcSmacallan /* 30 */ KEY_A, 580ac15d2bcSmacallan /* 31 */ KEY_S, 581ac15d2bcSmacallan /* 32 */ KEY_D, 582ac15d2bcSmacallan /* 33 */ KEY_F, 583ac15d2bcSmacallan /* 34 */ KEY_G, 584ac15d2bcSmacallan /* 35 */ KEY_H, 585ac15d2bcSmacallan /* 36 */ KEY_J, 586ac15d2bcSmacallan /* 37 */ KEY_K, 587ac15d2bcSmacallan /* 38 */ KEY_L, 588ac15d2bcSmacallan /* 39 */ KEY_SemiColon, 589ac15d2bcSmacallan /* 40 */ KEY_Quote, 590ac15d2bcSmacallan /* 41 */ KEY_Tilde, 591ac15d2bcSmacallan /* 42 */ KEY_ShiftL, 592ac15d2bcSmacallan /* 43 */ KEY_BSlash, 593ac15d2bcSmacallan /* 44 */ KEY_Z, 594ac15d2bcSmacallan /* 45 */ KEY_X, 595ac15d2bcSmacallan /* 46 */ KEY_C, 596ac15d2bcSmacallan /* 47 */ KEY_V, 597ac15d2bcSmacallan /* 48 */ KEY_B, 598ac15d2bcSmacallan /* 49 */ KEY_N, 599ac15d2bcSmacallan /* 50 */ KEY_M, 600ac15d2bcSmacallan /* 51 */ KEY_Comma, 601ac15d2bcSmacallan /* 52 */ KEY_Period, 602ac15d2bcSmacallan /* 53 */ KEY_Slash, 603ac15d2bcSmacallan /* 54 */ KEY_ShiftR, 604ac15d2bcSmacallan /* 55 */ KEY_KP_Multiply, 605ac15d2bcSmacallan /* 56 */ KEY_Alt, 606ac15d2bcSmacallan /* 57 */ KEY_Space, 607ac15d2bcSmacallan /* 58 */ KEY_CapsLock, 608ac15d2bcSmacallan /* 59 */ KEY_F1, 609ac15d2bcSmacallan /* 60 */ KEY_F2, 610ac15d2bcSmacallan /* 61 */ KEY_F3, 611ac15d2bcSmacallan /* 62 */ KEY_F4, 612ac15d2bcSmacallan /* 63 */ KEY_F5, 613ac15d2bcSmacallan /* 64 */ KEY_F6, 614ac15d2bcSmacallan /* 65 */ KEY_F7, 615ac15d2bcSmacallan /* 66 */ KEY_F8, 616ac15d2bcSmacallan /* 67 */ KEY_F9, 617ac15d2bcSmacallan /* 68 */ KEY_F10, 618ac15d2bcSmacallan /* 69 */ KEY_NumLock, 619ac15d2bcSmacallan /* 70 */ KEY_ScrollLock, 620ac15d2bcSmacallan /* 71 */ KEY_KP_7, 621ac15d2bcSmacallan /* 72 */ KEY_KP_8, 622ac15d2bcSmacallan /* 73 */ KEY_KP_9, 623ac15d2bcSmacallan /* 74 */ KEY_KP_Minus, 624ac15d2bcSmacallan /* 75 */ KEY_KP_4, 625ac15d2bcSmacallan /* 76 */ KEY_KP_5, 626ac15d2bcSmacallan /* 77 */ KEY_KP_6, 627ac15d2bcSmacallan /* 78 */ KEY_KP_Plus, 628ac15d2bcSmacallan /* 79 */ KEY_KP_1, 629ac15d2bcSmacallan /* 80 */ KEY_KP_2, 630ac15d2bcSmacallan /* 81 */ KEY_KP_3, 631ac15d2bcSmacallan /* 82 */ KEY_KP_0, 632ac15d2bcSmacallan /* 83 */ KEY_KP_Decimal, 633ac15d2bcSmacallan /* 84 */ KEY_NOTUSED, 634ac15d2bcSmacallan /* 85 */ KEY_NOTUSED, 635ac15d2bcSmacallan /* 86 */ KEY_Less, /* backslash on uk, < on german */ 636ac15d2bcSmacallan /* 87 */ KEY_F11, 637ac15d2bcSmacallan /* 88 */ KEY_F12, 638ac15d2bcSmacallan /* 89 */ KEY_NOTUSED, 639ac15d2bcSmacallan /* 90 */ KEY_NOTUSED, 640ac15d2bcSmacallan /* 91 */ KEY_NOTUSED, 641ac15d2bcSmacallan /* 92 */ KEY_NOTUSED, 642ac15d2bcSmacallan /* 93 */ KEY_NOTUSED, 643ac15d2bcSmacallan /* 94 */ KEY_NOTUSED, 644ac15d2bcSmacallan /* 95 */ KEY_NOTUSED, 645ac15d2bcSmacallan /* 96 */ KEY_NOTUSED, 646ac15d2bcSmacallan /* 97 */ KEY_NOTUSED, 647ac15d2bcSmacallan /* 98 */ KEY_NOTUSED, 648ac15d2bcSmacallan /* 99 */ KEY_NOTUSED, 649ac15d2bcSmacallan /* 100 */ KEY_NOTUSED, 650ac15d2bcSmacallan /* 101 */ KEY_NOTUSED, 651ac15d2bcSmacallan /* 102 */ KEY_NOTUSED, 652ac15d2bcSmacallan /* 103 */ KEY_NOTUSED, 653ac15d2bcSmacallan /* 104 */ KEY_NOTUSED, 654ac15d2bcSmacallan /* 105 */ KEY_NOTUSED, 655ac15d2bcSmacallan /* 106 */ KEY_NOTUSED, 656ac15d2bcSmacallan /* 107 */ KEY_NOTUSED, 657ac15d2bcSmacallan /* 108 */ KEY_NOTUSED, 658ac15d2bcSmacallan /* 109 */ KEY_NOTUSED, 659ac15d2bcSmacallan /* 110 */ KEY_NOTUSED, 660ac15d2bcSmacallan /* 111 */ KEY_NOTUSED, 661ac15d2bcSmacallan /* 112 */ KEY_NOTUSED, 662ac15d2bcSmacallan /* 113 */ KEY_NOTUSED, 663ac15d2bcSmacallan /* 114 */ KEY_NOTUSED, 664ac15d2bcSmacallan /* 115 */ KEY_NOTUSED, 665ac15d2bcSmacallan /* 116 */ KEY_NOTUSED, 666ac15d2bcSmacallan /* 117 */ KEY_NOTUSED, 667ac15d2bcSmacallan /* 118 */ KEY_NOTUSED, 668ac15d2bcSmacallan /* 119 */ KEY_NOTUSED, 669ac15d2bcSmacallan /* 120 */ KEY_NOTUSED, 670ac15d2bcSmacallan /* 121 */ KEY_NOTUSED, 671ac15d2bcSmacallan /* 122 */ KEY_NOTUSED, 672ac15d2bcSmacallan /* 123 */ KEY_NOTUSED, 673ac15d2bcSmacallan /* 124 */ KEY_NOTUSED, 674ac15d2bcSmacallan /* 125 */ KEY_NOTUSED, 675ac15d2bcSmacallan /* 126 */ KEY_NOTUSED, 676ac15d2bcSmacallan /* 127 */ KEY_Pause, 677ac15d2bcSmacallan /* 128 */ KEY_NOTUSED, 678ac15d2bcSmacallan /* 129 */ KEY_NOTUSED, 679ac15d2bcSmacallan /* 130 */ KEY_NOTUSED, 680ac15d2bcSmacallan /* 131 */ KEY_NOTUSED, 681ac15d2bcSmacallan /* 132 */ KEY_NOTUSED, 682ac15d2bcSmacallan /* 133 */ KEY_NOTUSED, 683ac15d2bcSmacallan /* 134 */ KEY_NOTUSED, 684ac15d2bcSmacallan /* 135 */ KEY_NOTUSED, 685ac15d2bcSmacallan /* 136 */ KEY_NOTUSED, 686ac15d2bcSmacallan /* 137 */ KEY_NOTUSED, 687ac15d2bcSmacallan /* 138 */ KEY_NOTUSED, 688ac15d2bcSmacallan /* 139 */ KEY_NOTUSED, 689ac15d2bcSmacallan /* 140 */ KEY_NOTUSED, 690ac15d2bcSmacallan /* 141 */ KEY_NOTUSED, 691ac15d2bcSmacallan /* 142 */ KEY_NOTUSED, 692ac15d2bcSmacallan /* 143 */ KEY_NOTUSED, 693ac15d2bcSmacallan /* 144 */ KEY_NOTUSED, 694ac15d2bcSmacallan /* 145 */ KEY_NOTUSED, 695ac15d2bcSmacallan /* 146 */ KEY_NOTUSED, 696ac15d2bcSmacallan /* 147 */ KEY_NOTUSED, 697ac15d2bcSmacallan /* 148 */ KEY_NOTUSED, 698ac15d2bcSmacallan /* 149 */ KEY_NOTUSED, 699ac15d2bcSmacallan /* 150 */ KEY_NOTUSED, 700ac15d2bcSmacallan /* 151 */ KEY_NOTUSED, 701ac15d2bcSmacallan /* 152 */ KEY_NOTUSED, 702ac15d2bcSmacallan /* 153 */ KEY_NOTUSED, 703ac15d2bcSmacallan /* 154 */ KEY_NOTUSED, 704ac15d2bcSmacallan /* 155 */ KEY_NOTUSED, 705ac15d2bcSmacallan /* 156 */ KEY_KP_Enter, 706ac15d2bcSmacallan /* 157 */ KEY_RCtrl, 707ac15d2bcSmacallan /* 158 */ KEY_NOTUSED, 708ac15d2bcSmacallan /* 159 */ KEY_NOTUSED, 709ac15d2bcSmacallan /* 160 */ KEY_Mute, 710ac15d2bcSmacallan /* 161 */ KEY_NOTUSED, 711ac15d2bcSmacallan /* 162 */ KEY_NOTUSED, 712ac15d2bcSmacallan /* 163 */ KEY_NOTUSED, 713ac15d2bcSmacallan /* 164 */ KEY_NOTUSED, 714ac15d2bcSmacallan /* 165 */ KEY_NOTUSED, 715ac15d2bcSmacallan /* 166 */ KEY_NOTUSED, 716ac15d2bcSmacallan /* 167 */ KEY_NOTUSED, 717ac15d2bcSmacallan /* 168 */ KEY_NOTUSED, 718ac15d2bcSmacallan /* 169 */ KEY_NOTUSED, 719ac15d2bcSmacallan /* 170 */ KEY_Print, 720ac15d2bcSmacallan /* 171 */ KEY_NOTUSED, 721ac15d2bcSmacallan /* 172 */ KEY_NOTUSED, 722ac15d2bcSmacallan /* 173 */ KEY_NOTUSED, 723ac15d2bcSmacallan /* 174 */ KEY_AudioLower, 724ac15d2bcSmacallan /* 175 */ KEY_AudioRaise, 725ac15d2bcSmacallan /* 176 */ KEY_NOTUSED, 726ac15d2bcSmacallan /* 177 */ KEY_NOTUSED, 727ac15d2bcSmacallan /* 178 */ KEY_NOTUSED, 728ac15d2bcSmacallan /* 179 */ KEY_NOTUSED, 729ac15d2bcSmacallan /* 180 */ KEY_NOTUSED, 730ac15d2bcSmacallan /* 181 */ KEY_KP_Divide, 731ac15d2bcSmacallan /* 182 */ KEY_NOTUSED, 732ac15d2bcSmacallan /* 183 */ KEY_Print, 733ac15d2bcSmacallan /* 184 */ KEY_AltLang, 734ac15d2bcSmacallan /* 185 */ KEY_NOTUSED, 735ac15d2bcSmacallan /* 186 */ KEY_NOTUSED, 736ac15d2bcSmacallan /* 187 */ KEY_NOTUSED, 737ac15d2bcSmacallan /* 188 */ KEY_NOTUSED, 738ac15d2bcSmacallan /* 189 */ KEY_NOTUSED, 739ac15d2bcSmacallan /* 190 */ KEY_NOTUSED, 740ac15d2bcSmacallan /* 191 */ KEY_NOTUSED, 741ac15d2bcSmacallan /* 192 */ KEY_NOTUSED, 742ac15d2bcSmacallan /* 193 */ KEY_NOTUSED, 743ac15d2bcSmacallan /* 194 */ KEY_NOTUSED, 744ac15d2bcSmacallan /* 195 */ KEY_NOTUSED, 745ac15d2bcSmacallan /* 196 */ KEY_NOTUSED, 746ac15d2bcSmacallan /* 197 */ KEY_NOTUSED, 747ac15d2bcSmacallan /* 198 */ KEY_NOTUSED, 748ac15d2bcSmacallan /* 199 */ KEY_Home, 749ac15d2bcSmacallan /* 200 */ KEY_Up, 750ac15d2bcSmacallan /* 201 */ KEY_PgUp, 751ac15d2bcSmacallan /* 202 */ KEY_NOTUSED, 752ac15d2bcSmacallan /* 203 */ KEY_Left, 753ac15d2bcSmacallan /* 204 */ KEY_NOTUSED, 754ac15d2bcSmacallan /* 205 */ KEY_Right, 755ac15d2bcSmacallan /* 206 */ KEY_NOTUSED, 756ac15d2bcSmacallan /* 207 */ KEY_End, 757ac15d2bcSmacallan /* 208 */ KEY_Down, 758ac15d2bcSmacallan /* 209 */ KEY_PgDown, 759ac15d2bcSmacallan /* 210 */ KEY_Insert, 760ac15d2bcSmacallan /* 211 */ KEY_Delete, 761ac15d2bcSmacallan /* 212 */ KEY_NOTUSED, 762ac15d2bcSmacallan /* 213 */ KEY_NOTUSED, 763ac15d2bcSmacallan /* 214 */ KEY_NOTUSED, 764ac15d2bcSmacallan /* 215 */ KEY_NOTUSED, 765ac15d2bcSmacallan /* 216 */ KEY_NOTUSED, 766ac15d2bcSmacallan /* 217 */ KEY_NOTUSED, 767ac15d2bcSmacallan /* 218 */ KEY_NOTUSED, 768ac15d2bcSmacallan /* 219 */ KEY_LMeta, 769ac15d2bcSmacallan /* 220 */ KEY_RMeta, 770ac15d2bcSmacallan /* 221 */ KEY_Menu, 771ac15d2bcSmacallan}; 772ac15d2bcSmacallan#define WS_XT_MAP_SIZE (sizeof(wsXtMap)/sizeof(unsigned char)) 773ac15d2bcSmacallan 774ac15d2bcSmacallanstatic 775ac15d2bcSmacallanTransMapRec wsXt = { 776ac15d2bcSmacallan 0, 777ac15d2bcSmacallan WS_XT_MAP_SIZE, 778ac15d2bcSmacallan wsXtMap 779ac15d2bcSmacallan}; 780ac15d2bcSmacallan 781ee3138f1Smrg/* Map for adb keyboards */ 782ee3138f1Smrgstatic CARD8 wsAdbMap[] = { 783ee3138f1Smrg /* 0 */ KEY_A, 784ee3138f1Smrg /* 1 */ KEY_S, 785ee3138f1Smrg /* 2 */ KEY_D, 786ee3138f1Smrg /* 3 */ KEY_F, 787ee3138f1Smrg /* 4 */ KEY_H, 788ee3138f1Smrg /* 5 */ KEY_G, 789ee3138f1Smrg /* 6 */ KEY_Z, 790ee3138f1Smrg /* 7 */ KEY_X, 791ee3138f1Smrg /* 8 */ KEY_C, 792ee3138f1Smrg /* 9 */ KEY_V, 793ee3138f1Smrg /* 10 */ KEY_UNKNOWN, /* @ # on french keyboards */ 794ee3138f1Smrg /* 11 */ KEY_B, 795ee3138f1Smrg /* 12 */ KEY_Q, 796ee3138f1Smrg /* 13 */ KEY_W, 797ee3138f1Smrg /* 14 */ KEY_E, 798ee3138f1Smrg /* 15 */ KEY_R, 799ee3138f1Smrg /* 16 */ KEY_Y, 800ee3138f1Smrg /* 17 */ KEY_T, 801ee3138f1Smrg /* 18 */ KEY_1, 802ee3138f1Smrg /* 19 */ KEY_2, 803ee3138f1Smrg /* 20 */ KEY_3, 804ee3138f1Smrg /* 21 */ KEY_4, 805ee3138f1Smrg /* 22 */ KEY_6, 806ee3138f1Smrg /* 23 */ KEY_5, 807ee3138f1Smrg /* 24 */ KEY_Equal, 808ee3138f1Smrg /* 25 */ KEY_9, 809ee3138f1Smrg /* 26 */ KEY_7, 810ee3138f1Smrg /* 27 */ KEY_Minus, 811ee3138f1Smrg /* 28 */ KEY_8, 812ee3138f1Smrg /* 29 */ KEY_0, 813ee3138f1Smrg /* 30 */ KEY_RBrace, 814ee3138f1Smrg /* 31 */ KEY_O, 815ee3138f1Smrg /* 32 */ KEY_U, 816ee3138f1Smrg /* 33 */ KEY_LBrace, 817ee3138f1Smrg /* 34 */ KEY_I, 818ee3138f1Smrg /* 35 */ KEY_P, 819ee3138f1Smrg /* 36 */ KEY_Enter, 820ee3138f1Smrg /* 37 */ KEY_L, 821ee3138f1Smrg /* 38 */ KEY_J, 822ee3138f1Smrg /* 39 */ KEY_Quote, 823ee3138f1Smrg /* 40 */ KEY_K, 824ee3138f1Smrg /* 41 */ KEY_SemiColon, 825ee3138f1Smrg /* 42 */ KEY_BSlash, 826ee3138f1Smrg /* 43 */ KEY_Comma, 827ee3138f1Smrg /* 44 */ KEY_Slash, 828ee3138f1Smrg /* 45 */ KEY_N, 829ee3138f1Smrg /* 46 */ KEY_M, 830ee3138f1Smrg /* 47 */ KEY_Period, 831ee3138f1Smrg /* 48 */ KEY_Tab, 832ee3138f1Smrg /* 49 */ KEY_Space, 833ee3138f1Smrg /* 50 */ KEY_Tilde, 834ac15d2bcSmacallan /* 51 */ KEY_BackSpace, 835ee3138f1Smrg /* 52 */ KEY_AltLang, 836ee3138f1Smrg /* 53 */ KEY_Escape, 837ee3138f1Smrg /* 54 */ KEY_LCtrl, 838ac15d2bcSmacallan /* 55 */ KEY_LMeta, 839ee3138f1Smrg /* 56 */ KEY_ShiftL, 840ee3138f1Smrg /* 57 */ KEY_CapsLock, 841ac15d2bcSmacallan /* 58 */ KEY_Alt, 842ee3138f1Smrg /* 59 */ KEY_Left, 843ee3138f1Smrg /* 60 */ KEY_Right, 844ee3138f1Smrg /* 61 */ KEY_Down, 845ee3138f1Smrg /* 62 */ KEY_Up, 846ee3138f1Smrg /* 63 */ KEY_UNKNOWN, /* Fn */ 847ee3138f1Smrg /* 64 */ KEY_NOTUSED, 848ee3138f1Smrg /* 65 */ KEY_KP_Decimal, 849ee3138f1Smrg /* 66 */ KEY_NOTUSED, 850ee3138f1Smrg /* 67 */ KEY_KP_Multiply, 851ee3138f1Smrg /* 68 */ KEY_NOTUSED, 852ee3138f1Smrg /* 69 */ KEY_KP_Plus, 853ee3138f1Smrg /* 70 */ KEY_NOTUSED, 854ac15d2bcSmacallan /* 71 */ KEY_NumLock, /* Clear */ 855ee3138f1Smrg /* 72 */ KEY_NOTUSED, 856ee3138f1Smrg /* 73 */ KEY_NOTUSED, 857ee3138f1Smrg /* 74 */ KEY_NOTUSED, 858ee3138f1Smrg /* 75 */ KEY_KP_Divide, 859ee3138f1Smrg /* 76 */ KEY_KP_Enter, 860ee3138f1Smrg /* 77 */ KEY_NOTUSED, 861ee3138f1Smrg /* 78 */ KEY_KP_Minus, 862ee3138f1Smrg /* 79 */ KEY_NOTUSED, 863ee3138f1Smrg /* 80 */ KEY_NOTUSED, 864ee3138f1Smrg /* 81 */ KEY_KP_Equal, /* Keypad = */ 865ee3138f1Smrg /* 82 */ KEY_KP_0, 866ee3138f1Smrg /* 83 */ KEY_KP_1, 867ee3138f1Smrg /* 84 */ KEY_KP_2, 868ee3138f1Smrg /* 85 */ KEY_KP_3, 869ee3138f1Smrg /* 86 */ KEY_KP_4, 870ee3138f1Smrg /* 87 */ KEY_KP_5, 871ee3138f1Smrg /* 88 */ KEY_KP_6, 872ee3138f1Smrg /* 89 */ KEY_KP_7, 873ee3138f1Smrg /* 90 */ KEY_NOTUSED, 874ee3138f1Smrg /* 91 */ KEY_KP_8, 875ee3138f1Smrg /* 92 */ KEY_KP_9, 876ee3138f1Smrg /* 93 */ KEY_NOTUSED, 877ee3138f1Smrg /* 94 */ KEY_NOTUSED, 878ac15d2bcSmacallan /* 95 */ KEY_KP_Decimal, /* Keypad , */ 879ee3138f1Smrg /* 96 */ KEY_F5, 880ee3138f1Smrg /* 97 */ KEY_F6, 881ee3138f1Smrg /* 98 */ KEY_F7, 882ee3138f1Smrg /* 99 */ KEY_F3, 883ee3138f1Smrg /* 100 */ KEY_F8, 884ee3138f1Smrg /* 101 */ KEY_F9, 885ee3138f1Smrg /* 102 */ KEY_NOTUSED, 886ee3138f1Smrg /* 103 */ KEY_F11, 887ee3138f1Smrg /* 104 */ KEY_NOTUSED, 888ac15d2bcSmacallan /* 105 */ KEY_Print, 889ee3138f1Smrg /* 106 */ KEY_KP_Enter, 890ac15d2bcSmacallan /* 107 */ KEY_ScrollLock, 891ee3138f1Smrg /* 108 */ KEY_NOTUSED, 892ee3138f1Smrg /* 109 */ KEY_F10, 893ee3138f1Smrg /* 110 */ KEY_NOTUSED, 894ee3138f1Smrg /* 111 */ KEY_F12, 895ee3138f1Smrg /* 112 */ KEY_NOTUSED, 896ac15d2bcSmacallan /* 113 */ KEY_Pause, 897ac15d2bcSmacallan /* 114 */ KEY_Insert, 898ee3138f1Smrg /* 115 */ KEY_Home, 899ee3138f1Smrg /* 116 */ KEY_PgUp, 900ac15d2bcSmacallan /* 117 */ KEY_Delete, 901ee3138f1Smrg /* 118 */ KEY_F4, 902ee3138f1Smrg /* 119 */ KEY_End, 903ee3138f1Smrg /* 120 */ KEY_F2, 904ee3138f1Smrg /* 121 */ KEY_PgDown, 905ac15d2bcSmacallan /* 122 */ KEY_F1, 906ac15d2bcSmacallan /* 123 */ KEY_NOTUSED, 907ac15d2bcSmacallan /* 124 */ KEY_NOTUSED, 908ac15d2bcSmacallan /* 125 */ KEY_NOTUSED, 909ac15d2bcSmacallan /* 126 */ KEY_NOTUSED, 910ac15d2bcSmacallan /* 127 */ KEY_Power 911ee3138f1Smrg}; 912ee3138f1Smrg#define WS_ADB_MAP_SIZE (sizeof(wsAdbMap)/sizeof(unsigned char)) 913ee3138f1Smrg 914ee3138f1Smrgstatic 915ee3138f1SmrgTransMapRec wsAdb = { 916ee3138f1Smrg 0, 917ee3138f1Smrg WS_ADB_MAP_SIZE, 918ee3138f1Smrg wsAdbMap 919ee3138f1Smrg}; 920ee3138f1Smrg 921ee3138f1Smrgstatic CARD8 wsSunMap[] = { 922ee3138f1Smrg /* 0x00 */ KEY_Help, 923ee3138f1Smrg /* 0x01 */ KEY_L1, /* stop */ 924ee3138f1Smrg /* 0x02 */ KEY_AudioLower, /* BrightnessDown / S-VolumeDown */ 925ee3138f1Smrg /* 0x03 */ KEY_L2, /* again */ 926ee3138f1Smrg /* 0x04 */ KEY_AudioRaise, /* BridgtnessUp / S-VolumeUp */ 927ee3138f1Smrg /* 0x05 */ KEY_F1, 928ee3138f1Smrg /* 0x06 */ KEY_F2, 929ee3138f1Smrg /* 0x07 */ KEY_F10, 930ee3138f1Smrg /* 0x08 */ KEY_F3, 931ee3138f1Smrg /* 0x09 */ KEY_F11, 932ee3138f1Smrg /* 0x0a */ KEY_F4, 933ee3138f1Smrg /* 0x0b */ KEY_F12, 934ee3138f1Smrg /* 0x0c */ KEY_F5, 935ee3138f1Smrg /* 0x0d */ KEY_AltLang, 936ee3138f1Smrg /* 0x0e */ KEY_F6, 937ee3138f1Smrg /* 0x0f */ KEY_NOTUSED, 938ee3138f1Smrg /* 0x10 */ KEY_F7, 939ee3138f1Smrg /* 0x11 */ KEY_F8, 940ee3138f1Smrg /* 0x12 */ KEY_F9, 941ee3138f1Smrg /* 0x13 */ KEY_Alt, 942ee3138f1Smrg /* 0x14 */ KEY_Up, 943ee3138f1Smrg /* 0x15 */ KEY_Pause, 944ee3138f1Smrg /* 0x16 */ KEY_Print, 945ee3138f1Smrg /* 0x17 */ KEY_ScrollLock, 946ee3138f1Smrg /* 0x18 */ KEY_Left, 947ee3138f1Smrg /* 0x19 */ KEY_L3, /* props */ 948ee3138f1Smrg /* 0x1a */ KEY_L4, /* undo */ 949ee3138f1Smrg /* 0x1b */ KEY_Down, 950ee3138f1Smrg /* 0x1c */ KEY_Right, 951ee3138f1Smrg /* 0x1d */ KEY_Escape, 952ee3138f1Smrg /* 0x1e */ KEY_1, 953ee3138f1Smrg /* 0x1f */ KEY_2, 954ee3138f1Smrg /* 0x20 */ KEY_3, 955ee3138f1Smrg /* 0x21 */ KEY_4, 956ee3138f1Smrg /* 0x22 */ KEY_5, 957ee3138f1Smrg /* 0x23 */ KEY_6, 958ee3138f1Smrg /* 0x24 */ KEY_7, 959ee3138f1Smrg /* 0x25 */ KEY_8, 960ee3138f1Smrg /* 0x26 */ KEY_9, 961ee3138f1Smrg /* 0x27 */ KEY_0, 962ee3138f1Smrg /* 0x28 */ KEY_Minus, 963ee3138f1Smrg /* 0x29 */ KEY_Equal, 964ee3138f1Smrg /* 0x2a */ KEY_Tilde, 965ee3138f1Smrg /* 0x2b */ KEY_BackSpace, 966ee3138f1Smrg /* 0x2c */ KEY_Insert, 967ee3138f1Smrg /* 0x2d */ KEY_Mute, /* Audio Mute */ 968ee3138f1Smrg /* 0x2e */ KEY_KP_Divide, 969ee3138f1Smrg /* 0x2f */ KEY_KP_Multiply, 970ac15d2bcSmacallan /* 0x30 */ KEY_Power, 971ee3138f1Smrg /* 0x31 */ KEY_L5, /* front */ 972ee3138f1Smrg /* 0x32 */ KEY_KP_Decimal, 973ee3138f1Smrg /* 0x33 */ KEY_L6, /* copy */ 974ee3138f1Smrg /* 0x34 */ KEY_Home, 975ee3138f1Smrg /* 0x35 */ KEY_Tab, 976ee3138f1Smrg /* 0x36 */ KEY_Q, 977ee3138f1Smrg /* 0x37 */ KEY_W, 978ee3138f1Smrg /* 0x38 */ KEY_E, 979ee3138f1Smrg /* 0x39 */ KEY_R, 980ee3138f1Smrg /* 0x3a */ KEY_T, 981ee3138f1Smrg /* 0x3b */ KEY_Y, 982ee3138f1Smrg /* 0x3c */ KEY_U, 983ee3138f1Smrg /* 0x3d */ KEY_I, 984ee3138f1Smrg /* 0x3e */ KEY_O, 985ee3138f1Smrg /* 0x3f */ KEY_P, 986ee3138f1Smrg /* 0x40 */ KEY_LBrace, 987ee3138f1Smrg /* 0x41 */ KEY_RBrace, 988ee3138f1Smrg /* 0x42 */ KEY_Delete, 989ee3138f1Smrg /* 0x43 */ KEY_Menu, /* compose */ 990ee3138f1Smrg /* 0x44 */ KEY_KP_7, 991ee3138f1Smrg /* 0x45 */ KEY_KP_8, 992ee3138f1Smrg /* 0x46 */ KEY_KP_9, 993ee3138f1Smrg /* 0x47 */ KEY_KP_Minus, 994ee3138f1Smrg /* 0x48 */ KEY_L7, /* open */ 995ee3138f1Smrg /* 0x49 */ KEY_L8, /* paste */ 996ee3138f1Smrg /* 0x4a */ KEY_End, 997ee3138f1Smrg /* 0x4b */ KEY_NOTUSED, 998ee3138f1Smrg /* 0x4c */ KEY_LCtrl, 999ee3138f1Smrg /* 0x4d */ KEY_A, 1000ee3138f1Smrg /* 0x4e */ KEY_S, 1001ee3138f1Smrg /* 0x4f */ KEY_D, 1002ee3138f1Smrg /* 0x50 */ KEY_F, 1003ee3138f1Smrg /* 0x51 */ KEY_G, 1004ee3138f1Smrg /* 0x52 */ KEY_H, 1005ee3138f1Smrg /* 0x53 */ KEY_J, 1006ee3138f1Smrg /* 0x54 */ KEY_K, 1007ee3138f1Smrg /* 0x55 */ KEY_L, 1008ee3138f1Smrg /* 0x56 */ KEY_SemiColon, 1009ee3138f1Smrg /* 0x57 */ KEY_Quote, 1010ee3138f1Smrg /* 0x58 */ KEY_BSlash, 1011ee3138f1Smrg /* 0x59 */ KEY_Enter, 1012ee3138f1Smrg /* 0x5a */ KEY_KP_Enter, 1013ee3138f1Smrg /* 0x5b */ KEY_KP_4, 1014ee3138f1Smrg /* 0x5c */ KEY_KP_5, 1015ee3138f1Smrg /* 0x5d */ KEY_KP_6, 1016ee3138f1Smrg /* 0x5e */ KEY_KP_0, 1017ee3138f1Smrg /* 0x5f */ KEY_L9, /* find */ 1018ee3138f1Smrg /* 0x60 */ KEY_PgUp, 1019ee3138f1Smrg /* 0x61 */ KEY_L10, /* cut */ 1020ee3138f1Smrg /* 0x62 */ KEY_NumLock, 1021ee3138f1Smrg /* 0x63 */ KEY_ShiftL, 1022ee3138f1Smrg /* 0x64 */ KEY_Z, 1023ee3138f1Smrg /* 0x65 */ KEY_X, 1024ee3138f1Smrg /* 0x66 */ KEY_C, 1025ee3138f1Smrg /* 0x67 */ KEY_V, 1026ee3138f1Smrg /* 0x68 */ KEY_B, 1027ee3138f1Smrg /* 0x69 */ KEY_N, 1028ee3138f1Smrg /* 0x6a */ KEY_M, 1029ee3138f1Smrg /* 0x6b */ KEY_Comma, 1030ee3138f1Smrg /* 0x6c */ KEY_Period, 1031ee3138f1Smrg /* 0x6d */ KEY_Slash, 1032ee3138f1Smrg /* 0x6e */ KEY_ShiftR, 1033ee3138f1Smrg /* 0x6f */ KEY_NOTUSED, /* linefeed */ 1034ee3138f1Smrg /* 0x70 */ KEY_KP_1, 1035ee3138f1Smrg /* 0x71 */ KEY_KP_2, 1036ee3138f1Smrg /* 0x72 */ KEY_KP_3, 1037ee3138f1Smrg /* 0x73 */ KEY_NOTUSED, 1038ee3138f1Smrg /* 0x74 */ KEY_NOTUSED, 1039ee3138f1Smrg /* 0x75 */ KEY_NOTUSED, 1040ac15d2bcSmacallan /* 0x76 */ KEY_Help, /* help */ 1041ee3138f1Smrg /* 0x77 */ KEY_CapsLock, 1042ee3138f1Smrg /* 0x78 */ KEY_LMeta, 1043ee3138f1Smrg /* 0x79 */ KEY_Space, 1044ee3138f1Smrg /* 0x7a */ KEY_RMeta, 1045ee3138f1Smrg /* 0x7b */ KEY_PgDown, 1046ee3138f1Smrg /* 0x7c */ KEY_Less, /* < > on some keyboards */ 1047ee3138f1Smrg /* 0x7d */ KEY_KP_Plus, 1048ee3138f1Smrg /* 0x7e */ KEY_NOTUSED, 1049ee3138f1Smrg /* 0x7f */ KEY_NOTUSED 1050ee3138f1Smrg}; 1051ee3138f1Smrg#define WS_SUN_MAP_SIZE (sizeof(wsSunMap)/sizeof(unsigned char)) 1052ee3138f1Smrg 1053ee3138f1Smrgstatic 1054ee3138f1SmrgTransMapRec wsSun = { 1055ee3138f1Smrg 0, 1056ee3138f1Smrg WS_SUN_MAP_SIZE, 1057ee3138f1Smrg wsSunMap 1058ee3138f1Smrg}; 1059ee3138f1Smrg 1060ee3138f1Smrg#endif /* WSCONS_SUPPORT */ 1061ee3138f1Smrg 1062ee3138f1Smrg/*ARGSUSED*/ 1063ee3138f1Smrg 1064ee3138f1Smrg/* 1065ee3138f1Smrg * KbdGetMapping -- 1066ee3138f1Smrg * Get the national keyboard mapping. The keyboard type is set, a new map 1067ee3138f1Smrg * and the modifiermap is computed. 1068ee3138f1Smrg */ 1069ee3138f1Smrg 1070ee3138f1Smrgvoid 1071ee3138f1SmrgKbdGetMapping (InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap) 1072ee3138f1Smrg{ 1073ee3138f1Smrg KbdDevPtr pKbd = (KbdDevPtr) pInfo->private; 1074ee3138f1Smrg KeySym *k; 1075ee3138f1Smrg int i; 1076ee3138f1Smrg 1077ee3138f1Smrg#ifndef __bsdi__ 1078ee3138f1Smrg switch (pKbd->consType) { 1079ee3138f1Smrg 1080ee3138f1Smrg#ifdef PCCONS_SUPPORT 1081ee3138f1Smrg case PCCONS: 1082ee3138f1Smrg#if defined(__OpenBSD__) 1083ee3138f1Smrg /* 1084ee3138f1Smrg * on OpenBSD, the pccons keymap is programmable, too 1085ee3138f1Smrg */ 1086ee3138f1Smrg { 1087ee3138f1Smrg pccons_keymap_t keymap[KB_NUM_KEYS]; 1088ee3138f1Smrg if (ioctl(pInfo->fd, CONSOLE_GET_KEYMAP, &keymap) != -1) { 1089ee3138f1Smrg for (i = 0; i < KB_NUM_KEYS; i++) 1090ee3138f1Smrg if (pccons_remap[i]) { 1091ee3138f1Smrg k = map + (pccons_remap[i] << 2); 1092ee3138f1Smrg switch (keymap[i].type) { 1093ee3138f1Smrg case KB_ASCII: 1094ee3138f1Smrg /* For ASCII keys, there is only one char in the keymap */ 1095ee3138f1Smrg k[0] = latin1_to_x[(unsigned char)keymap[i].unshift[0]]; 1096ee3138f1Smrg k[1] = latin1_to_x[(unsigned char)keymap[i].shift[0]]; 1097ee3138f1Smrg k[2] = latin1_to_x[(unsigned char)keymap[i].altgr[0]]; 1098ee3138f1Smrg k[3] = latin1_to_x[(unsigned char)keymap[i].shift_altgr[0]]; 1099ee3138f1Smrg break; 1100ee3138f1Smrg case KB_SCROLL: 1101ee3138f1Smrg k[0] = XK_Scroll_Lock; 1102ee3138f1Smrg goto special; 1103ee3138f1Smrg case KB_NUM: 1104ee3138f1Smrg k[0] = XK_Num_Lock; 1105ee3138f1Smrg goto special; 1106ee3138f1Smrg case KB_CAPS: 1107ee3138f1Smrg k[0] = XK_Caps_Lock; 1108ee3138f1Smrg goto special; 1109ee3138f1Smrg case KB_SHIFT: 1110ee3138f1Smrg switch (keymap[i].unshift[0]) { 1111ee3138f1Smrg case 1: 1112ee3138f1Smrg /* left shift */ 1113ee3138f1Smrg k[0] = XK_Shift_L; 1114ee3138f1Smrg break; 1115ee3138f1Smrg case 2: 1116ee3138f1Smrg /* right shift */ 1117ee3138f1Smrg k[0] = XK_Shift_R; 1118ee3138f1Smrg break; 1119ee3138f1Smrg default: 1120ee3138f1Smrg k[0] = NoSymbol; 1121ee3138f1Smrg } 1122ee3138f1Smrg goto special; 1123ee3138f1Smrg case KB_CTL: 1124ee3138f1Smrg k[0] = XK_Control_L; 1125ee3138f1Smrg goto special; 1126ee3138f1Smrg case KB_ALT: 1127ee3138f1Smrg k[0] = XK_Alt_L; 1128ee3138f1Smrg goto special; 1129ee3138f1Smrg case KB_FUNC: 1130ee3138f1Smrg switch (keymap[i].unshift[2]) { 1131ee3138f1Smrg case 'M': 1132ee3138f1Smrg k[0] = XK_F1; 1133ee3138f1Smrg break; 1134ee3138f1Smrg case 'N': 1135ee3138f1Smrg k[0] = XK_F2; 1136ee3138f1Smrg break; 1137ee3138f1Smrg case 'O': 1138ee3138f1Smrg k[0] = XK_F3; 1139ee3138f1Smrg break; 1140ee3138f1Smrg case 'P': 1141ee3138f1Smrg k[0] = XK_F4; 1142ee3138f1Smrg break; 1143ee3138f1Smrg case 'Q': 1144ee3138f1Smrg k[0] = XK_F5; 1145ee3138f1Smrg break; 1146ee3138f1Smrg case 'R': 1147ee3138f1Smrg k[0] = XK_F6; 1148ee3138f1Smrg break; 1149ee3138f1Smrg case 'S': 1150ee3138f1Smrg k[0] = XK_F7; 1151ee3138f1Smrg break; 1152ee3138f1Smrg case 'T': 1153ee3138f1Smrg k[0] = XK_F8; 1154ee3138f1Smrg break; 1155ee3138f1Smrg case 'U': 1156ee3138f1Smrg k[0] = XK_F9; 1157ee3138f1Smrg break; 1158ee3138f1Smrg case 'V': 1159ee3138f1Smrg k[0] = XK_F10; 1160ee3138f1Smrg break; 1161ee3138f1Smrg case 'W': 1162ee3138f1Smrg k[0] = XK_F11; 1163ee3138f1Smrg break; 1164ee3138f1Smrg case 'X': 1165ee3138f1Smrg k[0] = XK_F12; 1166ee3138f1Smrg break; 1167ee3138f1Smrg default: 1168ee3138f1Smrg k[0] = NoSymbol; 1169ee3138f1Smrg break; 1170ee3138f1Smrg } 1171ee3138f1Smrg goto special; 1172ee3138f1Smrg default: 1173ee3138f1Smrg k[0] = NoSymbol; 1174ee3138f1Smrg special: 1175ee3138f1Smrg k[1] = k[2] = k[3] = NoSymbol; 1176ee3138f1Smrg } 1177ee3138f1Smrg } 1178ee3138f1Smrg } else { 1179ee3138f1Smrg ErrorF("Can't read pccons keymap\n"); 1180ee3138f1Smrg } 1181ee3138f1Smrg } 1182ee3138f1Smrg#endif /* __OpenBSD__ */ 1183ee3138f1Smrg break; 1184ee3138f1Smrg#endif 1185ee3138f1Smrg 1186ee3138f1Smrg/* 1187ee3138f1Smrg * XXX wscons has no GIO_KEYMAP 1188ee3138f1Smrg */ 1189ee3138f1Smrg#if (defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)) && defined(GIO_KEYMAP) 1190ee3138f1Smrg case SYSCONS: 1191ee3138f1Smrg case PCVT: 1192ee3138f1Smrg { 1193ee3138f1Smrg keymap_t keymap; 1194ee3138f1Smrg 1195ee3138f1Smrg if (ioctl(pInfo->fd, GIO_KEYMAP, &keymap) != -1) { 1196ee3138f1Smrg for (i = 0; i < keymap.n_keys && i < NUM_KEYCODES; i++) 1197ee3138f1Smrg if (remap[i]) { 1198ee3138f1Smrg k = map + (remap[i] << 2); 1199ee3138f1Smrg k[0] = KD_GET_ENTRY(i,0); /* non-shifed */ 1200ee3138f1Smrg k[1] = KD_GET_ENTRY(i,1); /* shifted */ 1201ee3138f1Smrg k[2] = KD_GET_ENTRY(i,4); /* alt */ 1202ee3138f1Smrg k[3] = KD_GET_ENTRY(i,5); /* alt - shifted */ 1203ee3138f1Smrg if (k[3] == k[2]) k[3] = NoSymbol; 1204ee3138f1Smrg if (k[2] == k[1]) k[2] = NoSymbol; 1205ee3138f1Smrg if (k[1] == k[0]) k[1] = NoSymbol; 1206ee3138f1Smrg if (k[0] == k[2] && k[1] == k[3]) 1207ee3138f1Smrg k[2] = k[3] = NoSymbol; 1208ee3138f1Smrg } 1209ee3138f1Smrg } 1210ee3138f1Smrg } 1211ee3138f1Smrg break; 1212ee3138f1Smrg#endif /* SYSCONS || PCVT */ 1213ee3138f1Smrg 1214ee3138f1Smrg } 1215ee3138f1Smrg#endif /* !bsdi */ 1216ee3138f1Smrg 1217ee3138f1Smrg /* 1218ee3138f1Smrg * compute the modifier map 1219ee3138f1Smrg */ 1220ee3138f1Smrg for (i = 0; i < MAP_LENGTH; i++) 1221ee3138f1Smrg pModMap[i] = NoSymbol; /* make sure it is restored */ 1222ee3138f1Smrg 1223ee3138f1Smrg for (k = map, i = MIN_KEYCODE; 1224ee3138f1Smrg i < (NUM_KEYCODES + MIN_KEYCODE); 1225ee3138f1Smrg i++, k += 4) 1226ee3138f1Smrg 1227ee3138f1Smrg switch(*k) { 1228ee3138f1Smrg 1229ee3138f1Smrg case XK_Shift_L: 1230ee3138f1Smrg case XK_Shift_R: 1231ee3138f1Smrg pModMap[i] = ShiftMask; 1232ee3138f1Smrg break; 1233ee3138f1Smrg 1234ee3138f1Smrg case XK_Control_L: 1235ee3138f1Smrg case XK_Control_R: 1236ee3138f1Smrg pModMap[i] = ControlMask; 1237ee3138f1Smrg break; 1238ee3138f1Smrg 1239ee3138f1Smrg case XK_Caps_Lock: 1240ee3138f1Smrg pModMap[i] = LockMask; 1241ee3138f1Smrg break; 1242ee3138f1Smrg 1243ee3138f1Smrg case XK_Alt_L: 1244ee3138f1Smrg case XK_Alt_R: 1245ee3138f1Smrg pModMap[i] = AltMask; 1246ee3138f1Smrg break; 1247ee3138f1Smrg 1248ee3138f1Smrg case XK_Num_Lock: 1249ee3138f1Smrg pModMap[i] = NumLockMask; 1250ee3138f1Smrg break; 1251ee3138f1Smrg 1252ee3138f1Smrg case XK_Scroll_Lock: 1253ee3138f1Smrg pModMap[i] = ScrollLockMask; 1254ee3138f1Smrg break; 1255ee3138f1Smrg 1256ee3138f1Smrg /* kana support */ 1257ee3138f1Smrg case XK_Kana_Lock: 1258ee3138f1Smrg case XK_Kana_Shift: 1259ee3138f1Smrg pModMap[i] = KanaMask; 1260ee3138f1Smrg break; 1261ee3138f1Smrg 1262ee3138f1Smrg /* alternate toggle for multinational support */ 1263ee3138f1Smrg case XK_Mode_switch: 1264ee3138f1Smrg pModMap[i] = AltLangMask; 1265ee3138f1Smrg break; 1266ee3138f1Smrg 1267ee3138f1Smrg } 1268ee3138f1Smrg 1269ee3138f1Smrg pKbd->kbdType = 0; 1270ee3138f1Smrg 1271ee3138f1Smrg pKeySyms->map = map; 1272ee3138f1Smrg pKeySyms->mapWidth = GLYPHS_PER_KEY; 1273ee3138f1Smrg pKeySyms->minKeyCode = MIN_KEYCODE; 1274ee3138f1Smrg pKeySyms->maxKeyCode = MAX_KEYCODE; 1275ee3138f1Smrg 1276ee3138f1Smrg switch(pKbd->consType) { 1277ee3138f1Smrg#ifdef SYSCONS_SUPPORT 1278ee3138f1Smrg case SYSCONS: 1279ee3138f1Smrg if (pKbd->CustomKeycodes) 1280ee3138f1Smrg pKbd->scancodeMap = &sysconsCODE; 1281ee3138f1Smrg else 1282ee3138f1Smrg pKbd->RemapScanCode = ATScancode; 1283ee3138f1Smrg break; 1284ee3138f1Smrg#endif 1285ee3138f1Smrg#if defined(PCCONS_SUPPORT) || defined (PCVT_SUPPORT) 1286ee3138f1Smrg case PCCONS: 1287ee3138f1Smrg case PCVT: 1288ee3138f1Smrg pKbd->RemapScanCode = ATScancode; 1289ee3138f1Smrg break; 1290ee3138f1Smrg#endif 1291ee3138f1Smrg#ifdef WSCONS_SUPPORT 1292ee3138f1Smrg case WSCONS: 1293ee3138f1Smrg if (!pKbd->isConsole) { 1294ee3138f1Smrg switch (pKbd->wsKbdType) { 1295ee3138f1Smrg case WSKBD_TYPE_PC_XT: 1296ee3138f1Smrg case WSKBD_TYPE_PC_AT: 1297ac15d2bcSmacallan pKbd->scancodeMap = &wsXt; 1298ee3138f1Smrg break; 1299ee3138f1Smrg case WSKBD_TYPE_USB: 1300ee3138f1Smrg pKbd->scancodeMap = &wsUsb; 1301ee3138f1Smrg break; 1302ee3138f1Smrg#ifdef WSKBD_TYPE_ADB 1303ee3138f1Smrg case WSKBD_TYPE_ADB: 1304ee3138f1Smrg pKbd->scancodeMap = &wsAdb; 1305ee3138f1Smrg break; 1306ee3138f1Smrg#endif 1307ee3138f1Smrg#ifdef WSKBD_TYPE_SUN 1308ee3138f1Smrg#ifdef WSKBD_TYPE_SUN5 1309ee3138f1Smrg case WSKBD_TYPE_SUN5: 1310ee3138f1Smrg#endif 1311ee3138f1Smrg case WSKBD_TYPE_SUN: 1312ee3138f1Smrg pKbd->scancodeMap = &wsSun; 1313ee3138f1Smrg break; 1314ee3138f1Smrg#endif 1315ee3138f1Smrg default: 1316ee3138f1Smrg ErrorF("Unknown wskbd type %d\n", pKbd->wsKbdType); 1317ee3138f1Smrg } 1318ee3138f1Smrg } else { 1319ee3138f1Smrg pKbd->RemapScanCode = ATScancode; 1320ee3138f1Smrg } 1321ee3138f1Smrg break; 1322ee3138f1Smrg#endif 1323ee3138f1Smrg } 1324ee3138f1Smrg return; 1325ee3138f1Smrg} 1326