9.8. Keyboard configuration
To achieve a consistent keyboard configuration so that all applications interpret a keyboard event the same way, all programs in the Debian distribution must be configured to comply with the following guidelines.
The following keys must have the specified interpretations:
<--
delete the character to the left of the cursor
Delete
delete the character to the right of the cursor
Control+H
emacs: the help prefix
The interpretation of any keyboard events should be independent of the terminal that is used, be it a virtual console, an X terminal emulator, an rlogin/telnet session, etc.
The following list explains how the different programs should be set up to achieve this:
<--
generatesKB_BackSpace
in X.Delete
generatesKB_Delete
in X.X translations are set up to make
KB_Backspace
generate ASCII DEL, and to makeKB_Delete
generateESC [ 3 ~
(this is the vt220 escape code for the “delete character” key). This must be done by loading the X resources usingxrdb
on all local X displays, not using the application defaults, so that the translation resources used correspond to thexmodmap
settings.The Linux console is configured to make
<--
generate DEL, andDelete
generateESC [ 3 ~
.X applications are configured so that
<
deletes left, andDelete
deletes right. Motif applications already work like this.Terminals should have
stty erase ^?
.The
xterm
terminfo entry should haveESC [ 3 ~
forkdch1
, just as forTERM=linux
andTERM=vt220
.Emacs is programmed to map
KB_Backspace
or thestty erase
character todelete-backward-char
, andKB_Delete
orkdch1
todelete-forward-char
, and^H
tohelp
as always.Other applications use the
stty erase
character andkdch1
for the two delete keys, with ASCII DEL being “delete previous character” andkdch1
being “delete character under cursor”.
This will solve the problem except for the following cases:
Some terminals have a
<--
key that cannot be made to produce anything except^H
. On these terminals Emacs help will be unavailable on^H
(assuming that thestty erase
character takes precedence in Emacs, and has been set correctly).M-x help
orF1
(if available) can be used instead.Some operating systems use
^H
forstty erase
. However, modern telnet versions and all rlogin versions propagatestty
settings, and almost all UNIX versions honourstty erase
. Where thestty
settings are not propagated correctly, things can be made to work by usingstty
manually.Some systems (including previous Debian versions) use
xmodmap
to arrange for both<--
andDelete
to generateKB_Delete
. We can change the behavior of their X clients using the same X resources that we use to do it for our own clients, or configure our clients using their resources when things are the other way around. On displays configured like thisDelete
will not work, but<--
will.Some operating systems have different
kdch1
settings in theirterminfo
database forxterm
and others. On these systems theDelete
key will not work correctly when you log in from a system conforming to our policy, but<--
will.