tml%hemuli@FINGATE.BITNET (Tor Lillqvist) (05/22/88)
A little hint to anyone trying to get X11R2 up and running on HP9000/300 machines with non-US keyboards: In the file server/ddx/hp/hp/x_hil.c, around line 1246, the hpKeySyms and hpMapRec arrays are indexed using keyId, which is calculated as the keyboard nationality ID (_Using the HP-HIL Devices_, Table 4-4) minus 0x1f (the US code). These arrays, however, are of size one, and only contain the US keyboard mappings. Need I tell more? Note that I don't actually want the XK_odiaeresis, XK_Odiaeresis, etc. keys to generate these codes (I want them to generate 7-bit USASCII characters according to the traditional mapping (odiaeresis == '|', Odiaeresis == '\\', etc.)), but I guess I will have to take care of that using xmodmap or something. Diffs for my solution follow: *** /tmp/,RCSt1a07003 Sat May 21 22:22:48 1988 --- x_hil.c Sat May 21 21:42:19 1988 *************** *** 1241,1244 * nationality codes; they are the low order 5 bits of the devic ! * 0x1f is United States, so we'll subtract from 0x1f to give th ! * U.S. a keyId of zero; */ --- 1241,1243 ----- * nationality codes; they are the low order 5 bits of the devic ! * 0x1f is United States. */ *************** *** 1246,1248 if (pHPDev != NULL) ! keyId = 0x1f - (pHPDev->hil_header.id & 0x1f); else --- 1245,1247 ----- if (pHPDev != NULL) ! keyId = (pHPDev->hil_header.id & 0x1f); else *************** *** 1248,1250 else ! keyId = 0; --- 1247,1252 ----- else ! keyId = US; ! ! if (hpKeySyms[keyId].map == 0) ! keyId = US; *** /tmp/,RCSt1a07007 Sat May 21 22:23:19 1988 --- hpKeyMap.c Sat May 21 21:32:19 1988 *************** *** 189,190 KeySymsRec hpKeySyms[] = { --- 190,341 ----- + static KeySym FinnishMap[] = { + + /* code values in comments at line end are actual value reported on HIL. + REMEMBER, there is an offset of MIN_KEYCODE applied to this table! */ + /* Extend Char Right -- a.k.a. Kanji? */ + XK_Meta_R, NoSymbol, /* 0x02 */ + XK_Meta_L, NoSymbol, /* 0x03 */ + XK_Shift_R, NoSymbol, /* 0x4 */ + XK_Shift_L, NoSymbol, /* 0x5 */ + XK_Control_L, NoSymbol, /* 0x6 */ + XK_Break, XK_Reset, /* 0x7 */ + XK_KP_4, NoSymbol, /* 0x8 */ + XK_KP_8, NoSymbol, /* 0x9 */ + XK_KP_5, NoSymbol, /* 0xa */ + XK_KP_9, NoSymbol, /* 0xb */ + XK_KP_6, NoSymbol, /* 0xc */ + XK_KP_7, NoSymbol, /* 0xd */ + XK_KP_Separator, NoSymbol, /* 0xe */ + XK_KP_Enter, NoSymbol, /* 0xf */ + XK_KP_1, NoSymbol, /* 0x10 */ + XK_KP_Divide, NoSymbol, /* 0x11 */ + XK_KP_2, NoSymbol, /* 0x12 */ + XK_KP_Add, NoSymbol, /* 0x13 */ + XK_KP_3, NoSymbol, /* 0x14 */ + XK_KP_Multiply, NoSymbol, /* 0x15 */ + XK_KP_0, NoSymbol, /* 0x16 */ + XK_KP_Subtract, NoSymbol, /* 0x17 */ + XK_B, NoSymbol, /* 0x18 */ + XK_V, NoSymbol, /* 0x19 */ + XK_C, NoSymbol, /* 0x1a */ + XK_X, NoSymbol, /* 0x1b */ + XK_Z, NoSymbol, /* 0x1c */ + /* Was Kanji Left.... */ + XK_Kanji, NoSymbol, /* 0x1d */ + NoSymbol, NoSymbol, /* 0x1e */ + XK_Escape, XK_Delete, /* 0x1f */ + XK_KP_6, NoSymbol, /* 0x20 */ + XK_KP_F2, NoSymbol, /* 0x21 */ + XK_KP_3, NoSymbol, /* 0x22 */ + XK_KP_F3, NoSymbol, /* 0x23 */ + XK_KP_Decimal, NoSymbol, /* 0x24 */ + XK_KP_F1, NoSymbol, /* 0x25 */ + XK_KP_Tab, XK_KP_BackTab, /* 0x26 */ + XK_KP_F4, NoSymbol, /* 0x27 */ + XK_H, NoSymbol, /* 0x28 */ + XK_G, NoSymbol, /* 0x29 */ + XK_F, NoSymbol, /* 0x2a */ + XK_D, NoSymbol, /* 0x2b */ + XK_S, NoSymbol, /* 0x2c */ + XK_A, NoSymbol, /* 0x2d */ + NoSymbol, NoSymbol, /* 0x2e */ + XK_Caps_Lock, NoSymbol, /* 0x2f */ + XK_U, NoSymbol, /* 0x30 */ + XK_Y, NoSymbol, /* 0x31 */ + XK_T, NoSymbol, /* 0x32 */ + XK_R, NoSymbol, /* 0x33 */ + XK_E, NoSymbol, /* 0x34 */ + XK_W, NoSymbol, /* 0x35 */ + XK_Q, NoSymbol, /* 0x36 */ + XK_Tab, XK_BackTab, /* 0x37 */ + XK_7, XK_slash, /* 0x38 */ + XK_6, XK_ampersand, /* 0x39 */ + XK_5, XK_percent, /* 0x3a */ + XK_4, XK_dollar, /* 0x3b */ + XK_3, XK_numbersign, /* 0x3c */ + XK_2, XK_quotedbl, /* 0x3d */ + XK_1, XK_exclam, /* 0x3e */ + XK_less, XK_greater, /* 0x3f */ + /* Was Mouse-L */ + NoSymbol, NoSymbol, /* 0x40 */ + /* Was Mouse-M */ + NoSymbol, NoSymbol, /* 0x41 */ + /* Was Mouse-R */ + NoSymbol, NoSymbol, /* 0x42 */ + /* Was 4 button puck */ + NoSymbol, NoSymbol, /* 0x43 */ + NoSymbol, NoSymbol, /* 0x44 */ + NoSymbol, NoSymbol, /* 0x45 */ + NoSymbol, NoSymbol, /* 0x46 */ + NoSymbol, NoSymbol, /* 0x47 */ + XK_Menu, NoSymbol, /* 0x48 */ + XK_F4, NoSymbol, /* 0x49 */ + XK_F3, NoSymbol, /* 0x4a */ + XK_F2, NoSymbol, /* 0x4b */ + XK_F1, NoSymbol, /* 0x4c */ + NoSymbol, NoSymbol, /* 0x4d */ + /* Was 'Stop' */ + XK_Cancel, NoSymbol, /* 0x4e */ + /* Was 'Enter' */ + XK_Execute, XK_Print, /* 0x4f */ + XK_System, XK_User, /* 0x50 */ + XK_F5, NoSymbol, /* 0x51 */ + XK_F6, NoSymbol, /* 0x52 */ + XK_F7, NoSymbol, /* 0x53 */ + XK_F8, NoSymbol, /* 0x54 */ + NoSymbol, NoSymbol, /* 0x55 */ + XK_ClearLine, NoSymbol, /* 0x56 */ + /* Was 'Clear Display' */ + XK_Clear, NoSymbol, /* 0x57 */ + XK_8, XK_parenleft, /* 0x58 */ + XK_9, XK_parenright, /* 0x59 */ + XK_0, XK_equal, /* 0x5a */ + XK_plus, XK_question, /* 0x5b */ + XK_eacute, XK_Eacute, /* 0x5c */ + XK_BackSpace, NoSymbol, /* 0x5d */ + XK_InsertLine, NoSymbol, /* 0x5e */ + XK_DeleteLine, NoSymbol, /* 0x5f */ + + XK_I, NoSymbol, /* 0x60 */ + XK_O, NoSymbol, /* 0x61 */ + XK_P, NoSymbol, /* 0x62 */ + XK_aring, XK_Aring, /* 0x63 */ + XK_udiaeresis, XK_Udiaeresis, /* 0x64 */ + XK_quoteright, XK_asterisk, /* 0x65 */ + + /* HP special, might also be Insert */ + XK_InsertChar, NoSymbol, /* 0x66 */ + XK_DeleteChar, NoSymbol, /* 0x67 */ + XK_J, NoSymbol, /* 0x68 */ + XK_K, NoSymbol, /* 0x69 */ + XK_L, NoSymbol, /* 0x6a */ + XK_odiaeresis, XK_Odiaeresis, /* 0x6b */ + XK_adiaeresis, XK_Adiaeresis, /* 0x6c */ + XK_Return, NoSymbol, /* 0x6d */ + XK_Home, NoSymbol, /* 0x6e */ + /* Prev */ + XK_Prior, NoSymbol, /* 0x6f */ + + XK_M, NoSymbol, /* 0x70 */ + XK_comma, XK_semicolon, /* 0x71 */ + XK_period, XK_colon, /* 0x72 */ + XK_minus, XK_underscore, /* 0x73 */ + NoSymbol, NoSymbol, /* 0x74 */ + XK_Select, NoSymbol, /* 0x75 */ + NoSymbol, NoSymbol, /* 0x76 */ + XK_Next, NoSymbol, /* 0x77 */ + XK_N, NoSymbol, /* 0x78 */ + /* "Space, the final frontier..." */ + XK_space, NoSymbol, /* 0x79 */ + NoSymbol, NoSymbol, /* 0x7a */ + /* Kanji Right */ + XK_Kanji, NoSymbol, /* 0x7b */ + + XK_Left, NoSymbol, /* 0x7c */ + XK_Down, NoSymbol, /* 0x7d */ + XK_Up, NoSymbol, /* 0x7e */ + XK_Right, NoSymbol /* 0x7f */ + }; + + KeySymsRec hpKeySyms[] = { *************** *** 190,193 KeySymsRec hpKeySyms[] = { ! /* map minKeyCode maxKC width */ ! USASCIIMap, (MIN_KEYCODE + 0x02), (MIN_KEYCODE + 0x80), 2, }; --- 341,375 ----- KeySymsRec hpKeySyms[] = { ! /* map minKeyCode maxKC width nati ! 0, 0, 0, 0, /* 0x00 */ ! 0, 0, 0, 0, /* 0x01 */ ! 0, 0, 0, 0, /* 0x02 */ ! 0, 0, 0, 0, /* 0x03 */ ! 0, 0, 0, 0, /* 0x04 */ ! 0, 0, 0, 0, /* 0x05 */ ! 0, 0, 0, 0, /* 0x06 */ ! 0, 0, 0, 0, /* 0x07 */ ! 0, 0, 0, 0, /* 0x08 */ ! 0, 0, 0, 0, /* 0x09 */ ! 0, 0, 0, 0, /* 0x0a */ ! 0, 0, 0, 0, /* 0x0b */ ! 0, 0, 0, 0, /* 0x0c */ ! 0, 0, 0, 0, /* 0x0d */ ! 0, 0, 0, 0, /* 0x0e */ ! 0, 0, 0, 0, /* 0x0f */ ! 0, 0, 0, 0, /* 0x10 */ ! 0, 0, 0, 0, /* 0x11 */ ! 0, 0, 0, 0, /* 0x12 */ ! 0, 0, 0, 0, /* 0x13 */ ! 0, 0, 0, 0, /* 0x14 */ ! 0, 0, 0, 0, /* 0x15 */ ! FinnishMap, (MIN_KEYCODE + 0x02), (MIN_KEYCODE + 0x80), 2, /* 0x16 */ ! 0, 0, 0, 0, /* 0x17 */ ! 0, 0, 0, 0, /* 0x18 */ ! 0, 0, 0, 0, /* 0x19 */ ! 0, 0, 0, 0, /* 0x1a */ ! 0, 0, 0, 0, /* 0x1b */ ! 0, 0, 0, 0, /* 0x1c */ ! 0, 0, 0, 0, /* 0x1d */ ! 0, 0, 0, 0, /* 0x1e */ ! USASCIIMap, (MIN_KEYCODE + 0x02), (MIN_KEYCODE + 0x80), 2, /* 0x1f */ }; *************** *** 224,226 CARD8 *hpMapRec[] = { ! type0modmap, }; --- 406,439 ----- CARD8 *hpMapRec[] = { ! type0modmap, /* 0x 0 */ ! type0modmap, /* 0x01 */ ! type0modmap, /* 0x02 */ ! type0modmap, /* 0x03 */ ! type0modmap, /* 0x04 */ ! type0modmap, /* 0x05 */ ! type0modmap, /* 0x06 */ ! type0modmap, /* 0x07 */ ! type0modmap, /* 0x08 */ ! type0modmap, /* 0x09 */ ! type0modmap, /* 0x0a */ ! type0modmap, /* 0x0b */ ! type0modmap, /* 0x0c */ ! type0modmap, /* 0x0d */ ! type0modmap, /* 0x0e */ ! type0modmap, /* 0x0f */ ! type0modmap, /* 0x10 */ ! type0modmap, /* 0x11 */ ! type0modmap, /* 0x12 */ ! type0modmap, /* 0x13 */ ! type0modmap, /* 0x14 */ ! type0modmap, /* 0x15 */ ! type0modmap, /* 0x16 */ ! type0modmap, /* 0x17 */ ! type0modmap, /* 0x18 */ ! type0modmap, /* 0x19 */ ! type0modmap, /* 0x1a */ ! type0modmap, /* 0x1b */ ! type0modmap, /* 0x1c */ ! type0modmap, /* 0x1d */ ! type0modmap, /* 0x1e */ ! type0modmap, /* 0x1f */ }; Tor Lillqvist Technical Research Centre of Finland, Computing Services tml@hemuli.uucp == ...!mcvax!santra!hemuli!tml