billr@freal.cs.umass.edu (03/01/90)
I have a .emacs init file that includes key bindings for VT200-style application keypads. Right now I'm using a DECstation 2100 with X11 (DEC's version), a DEC LK201 keyboard and GNU emacs 18.55. The problem: I can't figure out how to get the numeric keypad to generate its "standard" application escape sequences rather than just numbers. I would *really like* to use my key bindings for these escape sequences. I have already tried running GNU Emacs in an xterm window without creating a new window (i.e., with the -nw option). This causes the keyboard to respond to the escape sequence <esc>= (i.e., change to application keypad), but does not allow me the use of the mouse. If I run emacs in a new window, I get the mouse, more efficient I/O, etc., but then the keyboard won't respond to <esc>= (even though $TERM is set to "xterm"), and so I can't get it to go into application keypad mode. I have been told that this problem must be solved at the X level, not within Emacs. Any suggestions you have would be much appreciated! Since I don't usually read this newsgroup, I'd appreciate responses by mail: rosenblatt@cs.umass.edu or billr@fantasy.cs.umass.edu Thanks - bill rosenblatt.
jv@mh.nl (Johan Vromans) (03/02/90)
In article <10754@dime.cs.umass.edu> billr@freal.cs.umass.edu writes: > I have a .emacs init file that includes key bindings for VT200-style > application keypads. Right now I'm using a DECstation 2100 with > X11 (DEC's version), a DEC LK201 keyboard and GNU emacs 18.55. > The problem: I can't figure out how to get the numeric keypad to > generate its "standard" application escape sequences rather than > just numbers. .... Since this question pops up frequently, I'll follow-up. There are two ways I have solved this. 1. Modify x11term.c to understand the keypad keys, and issue the corresponding vt300 escape sequences 2. Implement x-rebind-key and use this. The latter approach I like most. Besides, it is not limited to LK201 keyboards only. I have moved the rebind-key function from epoch into emacs18.55, so now I can use the same startup code for both X and normal terminal. BTW this also allows use of function keys [normal and shifted], the edit keys etc. In my startup, I do the following: (if (string= (window-system "x")) (progn (x-rebind-key "KP_0" 0 "\033Op") ; keypad 0 (x-rebind-key "KP_1" 0 "\033Oq") ; keypad 1 ... )) ;; now this works for a normal terminal and on the workstation (global-set-key "\033Op" 'forward-line) (global-set-key "\033Oq" 'beginning-of-line) .... (Details differ, hope you get the idea.) I can send/post you the diffs, if there is sufficient interest. 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" -------------------------