[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#2313: xterm keymapping problems suspected

Raul Miller:
   > The right way to solve the problem is give the Linux console
   > distinct Backspace and Delete key symbols, so that X can pick
   > them up.

Bill Mitchell:
   but went on to say:

Raul Miller:
   > I think that both of these should typically generate the ascii
   > 127 character.  This would go into the kbd package and the kernel
   > and should be coordinated with upstream.

Bill Mitchell:
   These two statements seem to conflict with one another.

But they don't.  Honest!  :-)

Here's what I was thinking -- under X there's two common ways for
programs to look at keyboard activity: as a sequence of ascii
characters, or as a sequence of keysyms.  Some programs (typically,
those running in a terminal window) don't care about the X-specific
bindings, others (typically, those running in their own window) don't
care about the ascii bindings.

>From an old mini-howto, I got the impression that the X BackSpace
keysym would map to the ascii 127 character.  Unfortunately, on
examination, I'm wrong.

On the third hand, emacs running in its own window under X will do the
right thing (delete to the left) with the BackSpace keysym -- even
though XLookupString maps it to an ascii 8.

Here's the defaults:

    console				   XFree86
keycode	keysym	   ascii		keycode keysym       ascii (xterm)
 14     Delete	   127			 22     Delete       127
 29+35  Control+h    8			 37+43  Control_L+h    8
 97+35	Control+h    8			109+43  Control_R+h    8
 83	KP_Period   27 91 51 126	 91     KP_Decimal    46
105	Left	    27 91 68		100     Left          27 91 68		*
111	Remove	   127			107     Delete       127
 29+14  BackSpace    8			 29+14  -      	     127
 97+14  BackSpace    8			109+14  -      	     127
      					  -     BackSpace      8

* XLookupString returns 0 characters for this keysym.

[Note for die-hards: I've left scan codes off of this table.]


Summary: linux console and xterm provide different (though similar)
terminal emulation, and X, as a general case, is different from xterm.


My current preference is to track the defaults as closely as possible,
but to give people a clear option for something more msdos-like.  By
the way, here's what stty says about a linux session [which does not
appear to have been configured by any prior stty's]:

intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;

One final note: vi respects these settings, most other screen editors
(e.g. emacs and ae) do not.  These settings happen to coincide with
the key bindings of emacs, and with the settings that stty would put
in place with stty -dec.  These settings also happen to coincide with
the key bindings of ae with version 493-10 [which, I presume you (Bill
Mitchell) have configured].


Reply to: