Get <backup> and <delete> keys right with a LK400 keyboard

Problem
Most of the KP3 Xterminals have a DEC LK400 compatible keyboard, which is great if one works on VMS, but since it differs from the canonical PC keyboard layout, give you some configuration headaches when used in a Linux enviroment, and in particular, in a mixed Linux/VMS environment. The key problem is

In VMS
  • the keysym <Delete> and the ASCII code 127 (DEL) is used to delete the character left of the cursor.
  • the keysym <BackSpace> and the ASCII code 8 (BS) is used to go back to the beginning of the line.
In Linux
  • the keysym <Delete> and the ASCII code 127 (DEL) is used to delete the character right of the cursor.
  • the keysym <BackSpace> and the ASCII code 8 (BS) is used to delete the character left of the cursor.

As a consequence, in a VMS environment the LK400 keyboard is setup such that

Clearly, this is highly inconvenient under Linux, and it's therefore a common practice to map them just the opposite way. This makes working under Linux a pleasure, however, telnetting to VMS becomes a nightmare.

Solution
If your primary connection with your Xterminal is to a Linux system it's best to setup the keymapping for optimal Linux use, that is

This is achived with

Note, that I had also to fix the mappinmg of the key marked "`" and "~" (left of "1"), so it's included in above ~/.Xmodmap file.

What remains is to make working under VMS possible again. All what is required is to interchange the mapping of <BackSpace> and <Delete> keys. This remapping can be done with xterm. To create a variant of xterm with a VMS style key mapping

Note the "\n\" at the end of the first line. Note, that after a change of .Xresources you'll have to restart your X session or run 'xrdb -merge .Xresources'. Note also, that the trick above works with xterm, but it so far does not work with rxvt and kvt.

Typing the command vmsterm will now, assuming that ~/bin is in your $PATH, start xterm with the a special translation, restoring the keymapping as it used to be under VMS.

Discussion
The mapping of keys to keysym's is global to all applications connected to one X server. It can be setup with xmodmap. All X applications see keyboard input in the form of events indicating that a certain keysym has been pressed or released. This can for example be probed with the xev program.

Terminal emulators, like xterm, now translate those keysym again back into ASCII codes, like the input from good old VT100 terminals. The xterm program allows to configure this mapping via the VT100.Translations resource.

To have now an unadulted version of xterm for Linux/Unix work and an additional version with a modified mapping, one has to use the hack with the symlink. A program started via a symlink will look under the symlink name and not under it's original name in the resource database, allowing to have two setups for one program.

Further Reading
The issue of `how to get backspace and delete right' is one of the most persistent and talked upon issues at all. It is covered in the following articles
Back to FAQ Summary
Walter F.J. Müller
Last modified: Mon Aug 16 09:37:56 CEST 1999
Imprint ---- Data privacy protection ---- Haftungsausschluss