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