Fix that Irritating Delete Key!

Contributed by Tom Rockwell

Here's how to fix backspace key on an Xterm so that it deletes to the left in Wincenter.

Background:

This is probably too simplistic and may be wrong, if you want more detail you'll have to look elsewhere. The Xwindows system maps the keys on the terminal keyboard to a set of function names that applications use. Each key has a keycode number that depends on the specific terminal type being used, i.e. the keys on a NCD Xterm will probably have different keycode from the keys on a Tektronix Xterm. Applications have functions such as "g" for the letter g and "Delete" or "BackSpace" for deleting characters. The user can control the mapping of keycodes to functions using the program xmodmap on the SGI's. When you use Xmodmap it changes the mapping for your TERMINAL and not just the window you ran it in.

The Problem:

On my Xterm the delete key mapped to the function name "Delete". (The correct X-terminology for the function name is "keysym".) In WinCenter the "Delete" function removes the character the right of the cursor; the "BackSpace" function removes the character to the left of the cursor. So I want to change the the mapping of my Xterm's delete key to the function "BackSpace".

The Fix:

There is a program called xev on the SGIs that will echo what X signals are being sent. Start xev and move the cursor into its window. Now press the delete key and get keycode for the delete key on your keyboard. On my Xterm it's keycode number was 102. If you can find a machine that has keys that function correctly for your application you can run xev on it to find out what functions (keysyms) the application is expecting. I did this to find that Wincenter expected the function "BackSpace".

On the SGIs you can use the xmodmap program to change the mapping of the keyboard. Here's the command I used:

> xmodmap -e 'keycode 102 = BackSpace Delete'
(from an SGI window on my Alpha I determined my delete key is keycode 188. I issued the above command and it reassigned my delete key just like the xterm---JPK)

Now my delete key sends "BackSpace" when pressed unshifted and "Delete" when pressed shifted. The delete key now erases to the left in WinCenter.

The New Problem:

For many programs both "BackSpace" and "Delete" remove to the left, but for others "BackSpace" will have some other result. Notably DECTERMs move the cursor to the beginning of line for "BackSpace". I don't know if there is a way to make the delete key work for both WinCenter and DECTERMs at the same time.


Go Back toComputing Page