HPlogo Using the X Window System > Appendix A Using the Keyboards

Changing Key Mapping

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

X provides the means to change the key mapping, if you so desire. One way to accomplish this is by running the xmodmap client program. Hewlett-Packard provides two files in the directory /usr/lib/X11 to use with xmodmap. One, XPCmodmap, causes xmodmap to change the key mapping to match the keycap engravings on the C1429 keyboard. The other, XHPmodmap, causes xmodmap to change the key mapping to match the keycap engravings on the 46021 keyboard, which are the defaults. This allows either keyboard to be used with applications that expect the other keyboard, although only one mapping can be used at any given time. When the mapping is changed, the X Server notifies all clients that are executing at that time. Some clients may load the new mapping from the server right away, but others may have to be restarted in order to recognize the new mapping. For more information about using the xmodmap client, see the xmodmap man page. Additional information can be found in Chapter 9 “Customizing the Mouse and Keyboard”.

C1429 Keyboard

Execute the following command to change the mapping of the keys shown above to match the engravings on the C1429 keycaps. /usr/bin/X11/xmodmap /usr/lib/X11/XPCmodmap

46021 Keyboard

Execute the following command to change the mapping to match the 46021 keyboard. /usr/bin/X11/xmodmap /usr/lib/X11/XHPmodmap

Comparing the Keyboards

The 46021 keyboard has 107 keys, while the C1429 keyboard has 101 keys. There are 7 keys on the 46021 keyboard whose keycodes cannot be generated by any key on the C1429 keyboard, and whose key symbols cannot be generated when using the default keymap for the C1429 keyboard. The missing keys are:

  • Clear line

  • Clear display

  • Insert line

  • Delete line

  • Print/Enter

  • , (on number pad)

  • Tab (on number pad)

, and Tab exist elsewhere on the C1429 keyboard, and the others are not needed by most applications. Applications that do need one or more of them must assign their key symbols to the keycodes of existing keys. The xmodmap client can be used to determine the keycode-to-key symbol mapping of existing keys, and it can also be used to assign the key symbol to the desired keycode. These keys use HP specific key symbol names whose correct spelling can be found in the file /usr/lib/X11/XKeysymDB.

The Right Control key on the C1429 keyboard generates a keycode that has no equivalent on the 46021 keyboard. This key has the same effect as the Left Control key by default.

Keys not mentioned above exist on both keyboards, and have the same key symbols.

© 1995 Hewlett-Packard Development Company, L.P.