HDS ViewStation System Administrator's Guide

A Hypertext Document


Using Xmodmap to Customize a Keyboard

This page describes using Xmodmap to modify keymappings.

Xmodmap Modifications
If you want to modify the ViewStation's keyboard behavior in a global way, so it affects all clients and all situations, you can do it with xmodmap.

Mouse Button Changes
You can change the function of the mouse keys to make it easier for left-handed users to operate the mouse. Normally the most frequently used mouse key is the left button, which corresponds to the index finger of a right-handed user. To reverse the button order (to use the index finger of a left-handed person) use this entry on the xmodmap command line or in the xmodmap file:

xmodmap -e "pointer = 3 2 1"

Modifier and Lock Key Changes
Another commonly requested change is to swap the CapsLock key with the Left Ctrl key (note that some keyboards have a DIP switch to make this change). This example is taken from the manual pages for xmodmap. Note that the Lock and Control functions are removed, then keysyms assigned, then the Lock and Control functions are added.

! Xmodmap data file which swaps the CapsLock and Left Ctrl keys.
! Usage: xmodmap .xmodmap-swap-keys
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L


Keysym Changes
You can change the actual keymap definitions by associating a keycode with a different keysym in the xmodmap file. This is permitted behavior, but it is not recommended because it may cause unexpected changes. It is better to use keysym to keysym assignments than to use keycode to keysym assignments. A change often used is assigning the Backspace function to the Delete key, which is done as follows:

xmodmap -e "keysym Delete = Backspace"

Note that this entry changes one keysym to another. Modifying the xmodmap table that links a keycode to a keysym is not recommended because it links the new keysym to a particular keycode (hardware type). If you use that keymap with another keyboard, it may not work. The keysym/keysym translation will always work.

These commands can be used on an individual xmodmap command line or grouped in a file which is then read by xmodmap. Xmodmap is typically read from an .xsession file or some other startup file.

Note that the xmodmap client is available as a ViewStation local client. You could use the local xmodmap in a ViewStation server-reset file to make your keyboard modifications even before you log in. This is an advantage to users with special keyboard requirements because even the username and password will use the modified keymapping (this is not true of host-based xmodmap).

Return to Section Heading Page


Return to the Home Page

If you need more information than is available here, you can reach HDS via email at info@hds.com, or call us at 1.800.HDS.1551 in the USA, or at +610.277.8300 from outside the US. For questions or problems regarding the HDS WWW page, contact webmaster@hds.com.
© 1996 by HDS Network Systems Inc.