Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!gem.mps.ohio-state.edu!apple!agate!shelby!decwrl!hplabs!hp-sdd!hp-pcd!hplsla!hpubvwa!grlab!scott From: scott@grlab.UUCP (Scott Blachowicz) Newsgroups: comp.windows.x Subject: Re: vt100 keypad codes on xemacs Message-ID: Date: 5 Oct 89 14:31:18 GMT References: <1304@gmdzi.UUCP> Sender: scott@grlab.UUCP Organization: Graphicus, Inc., Kirkland, WA USA Lines: 38 In-reply-to: wittig@gmdzi.UUCP's message of 3 Oct 89 11:30:29 GMT In article <1304@gmdzi.UUCP> wittig@gmdzi.UUCP (Georg Wittig) writes: >Gnu Emacs 18.53 and X11R3: >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'. >... >So it seems that the software binding does work, but not the mapping of the >keypad key `.' to the above escape sequence. > >What am I missing? The trick is that emacs creates its own window and handles all of the X interactions with that window. When you hit a key in the X window, it essentially sends a "keycode" to the X client (emacs). The keycode is supposed to be a unique identifier for the particular key pressed (not necessarily its terminal-based interpretation). At any rate, the `.' key on the keypad probably returns the keycode `XK_KP_Decimal' to emacs which I think is ignored. (the source code for this stuff is in the emacs src/x11term.c file..a function called `string_func_vals' is involved...) I hacked ours up a little bit to get it to recognize some of the keycodes returned by my keyboard (Hewlett-Packard), so a lot of my "special" keys "send back" an escape sequence like `\e&x51sX' which denotes the key I've designated as `51' with the Shift modifier pressed. I then have a special terminal function key setup elisp file that I load if running under X that does things like bind my `Menu' key to the `buffer-menu' function and setup the editing and arrow keys. (If anyone is interested in this, let me know & I'll see what I can do). I noticed several places in the source where some code to do a more general job of this "keycode-mapping" was #ifdef'd out. It looked like work-in-progress, but not quite finished, yet. Anyone know when it might be reality? -- Scott Blachowicz E-mail: scott@grlab.UUCP USPS: Graphicus ..or.. ...!hpubvwa!grlab!scott 150 Lake Str S, #206 VoicePh: 206/828-4691 Kirkland, WA 98033 FAX: 206/828-4236