[gnu.emacs] VT100 keypad codes on Gnu Emacs

worley@EDDIE.MIT.EDU (Dale Worley) (10/06/89)

   The keypad key `.' on a vt100 keyboard emits the escape sequence
   ``ESC O n'' (3 hex. characters). In the non-X11 emacs (`-nw'
   switch) this code is bound to `delete-char'.

   In xemacs however, this doesn't work.

   Interestingly, typing `Cntl-Q' and then the keypad key `.' inserts
   a `.' into the buffer. The function `delete-char' is executed if I
   enter the escape sequence `ESC O n' (3 key strokes) "on foot".

   So it seems that the software binding does work, but not the
   mapping of the keypad key `.' to the above escape sequence.

Most likely, the VT100 is not being sent the escape sequence that
turns on "alternate keypad mode", i.e., makes keypad keys send ESC
<mumble>, rather than digits, etc.  This escape sequence is probably
in the VT100 termcap entry, which the display code sends very early in
Emacs initialization.  If Emacs doesn't figure out early enough what
sort of terminal it is dealing with, it won't send the VT100
initialization string.

You might try using send-string-to-terminal to send the "turn on
alternate keypad mode" escape sequence to the VT100, and see if this
clears up the problem.

Dale

jv@mh.nl (Johan Vromans) (10/08/89)

In article <8910061359.AA13718@sn1987a.compass.com> compass!worley@EDDIE.MIT.EDU (Dale Worley) writes:
      So it seems that the software binding does work, but not the
      mapping of the keypad key `.' to the above escape sequence.

   Most likely, the VT100 is not being sent the escape sequence that
   turns on "alternate keypad mode", i.e., makes keypad keys send ESC
   <mumble>, rather than digits, etc.

I have found out that the Emacs X11 code handling the keyboard is a
bit broken at some places. The numeric keypad is not supported, nor
are most of the other VT2xx/VT3xx function keys.

I have posted a patch to x11term.c some time ago, to have it handle
the LK201 keyboard (all keys the send their VT300 control sequence).
I'm not saying this is the only solution, but it works fine.I can send
it if you like.

Johan
--
--
Johan Vromans				       jv@mh.nl via internet backbones
Multihouse Automatisering bv		       uucp: ..!{uunet,hp4nl}!mh.nl!jv
Doesburgweg 7, 2803 PL Gouda, The Netherlands  phone/fax: +31 1820 62944/62500
------------------------ "Arms are made for hugging" -------------------------

wittig@gmdzi.UUCP (Georg Wittig) (10/18/89)

In compass!worley@EDDIE.MIT.EDU (Dale Worley) writes:

>Most likely, the VT100 is not being sent the escape sequence that
>turns on "alternate keypad mode", i.e., makes keypad keys send ESC
><mumble>, rather than digits, etc.
>                      If Emacs doesn't figure out early enough what
>sort of terminal it is dealing with, it won't send the VT100
>initialization string.

>You might try using send-string-to-terminal to send the "turn on
>alternate keypad mode" escape sequence to the VT100, and see if this
>clears up the problem.

I tried this: 

	(send-string-to-terminal "A")

sends the A to the terminal window, not to the emacs window :-(
grumble ....




-- 
Georg Wittig   GMD-Z1.BI   P.O. Box 1240   D-5205 St. Augustin 1 (West Germany)
email: wittig@gmdzi.uucp   phone: (+49 2241) 14-2294
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Freedom's just another word for nothing left to lose" (Kris Kristofferson)