Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!hp4nl!mhres!jv From: jv@mh.nl (Johan Vromans) Newsgroups: gnu.emacs Subject: Re: Xwindows application keypad support Message-ID: Date: 1 Mar 90 20:49:07 GMT References: <10754@dime.cs.umass.edu> Sender: jv@mhres.mh.nl Organization: Multihouse Gouda, the Netherlands Lines: 50 In-reply-to: billr@freal.cs.umass.edu's message of 28 Feb 90 20:04:54 GMT 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" -------------------------