Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!brl-adm!seismo!nbires!hao!noao!arizona!gudeman From: gudeman@arizona.UUCP Newsgroups: comp.emacs Subject: Re: vt100 cursor keys Message-ID: <1506@megaron.arizona.edu> Date: Tue, 10-Feb-87 13:28:21 EST Article-I.D.: megaron.1506 Posted: Tue Feb 10 13:28:21 1987 Date-Received: Thu, 12-Feb-87 23:56:41 EST Organization: U of Arizona CS Dept, Tucson Lines: 43 From: earleh@dartvax.UUCP (Earle R. Horton) Date: 8 Feb 87 17:25:50 GMT In article <265@hqda-ai.UUCP>, merlin@hqda-ai.UUCP (David S. Hayes) writes: > key functions. The vt100 key sequences all start with ESC-[, Sorry to be picky, but some of them start with ESC-O. This seems to depend on whether the terminal is in "ANSI" mode or "VT100" mode. (That's an "Oh", not a "zero".) I am no expert on the subject, but I think the sequence usually used by editors to "turn on" the keypad ("\E=") puts it in ANSI mode, and then the sequences all start with ESC-O. This is the case for wy75 terminals, which claim to be vt100 compatible, so it may work for vt100's. Put "ks=\E[?1h\E=" in your termcap. The "ks" entry is for keypad start, "\E[?1h" makes the arrow keys send "ESC O" sequences instead of "ESC [", and "\E=" makes the keypad send "ESC O" sequences. Also, every once in a while, the "ESC O" sequence gets changed to "ESC G" somehow (every 100 times or so), so you should bind both to the same keymap. Here is part of my file "keypad.el", which is loaded from my ".emacs". To find out the code associated with a keypad key, type "^Q" followed by the key. (defvar ESC-O-keymap (make-keymap) "Keymap for arrow and keypad keys") (global-set-key "\eO" ESC-O-keymap) (global-set-key "\eG" ESC-O-keymap) ; sometimes sent as prefix for keypad ; keys, probably a transmission error. (define-key ESC-O-keymap "D" 'backward-char) ; <- (define-key ESC-O-keymap "C" 'forward-char) ; -> (define-key ESC-O-keymap "A" 'previous-line) ; up-arrow (define-key ESC-O-keymap "B" 'next-line) ; dn-arrow (define-key ESC-O-keymap "H" 'home) ; Home (fset 'home "[0 ") ; home goes to the beginning of the current ; paragraph and puts that line at the top of ; the window. (define-key ESC-O-keymap "l" 'scroll-down) ; KPD-, (define-key ESC-O-keymap "M" 'scroll-up) ; Enter (define-key ESC-O-keymap "n" 'move-to-window-line) ; KPD-.