Keypad defs' for EMACS under AT386 terminal type..????
Jim Balter
jim at segue.segue.com
Thu May 2 11:59:10 AEST 1991
In article <1991Apr29.204040.14429 at jato.jpl.nasa.gov> dave at elxr.jpl.nasa.gov writes:
>The problem is, let's say you do a search...and then failing to find
>anything you want to use the cursor keys. The darn thing eats the ESC
>character (I think it wants to use that character to signify end of
>searching) and then the rest of the keycode shows gleefully up in
>your edited file.
Given the way that GNU emacs handles keys and key maps, I don't think there's
anything you can do about this. Incremental search interprets keys at a level
lower than the key map, so it will see your arrow or function keys as a series
of keystrokes.
Here's the at386.el that we use here:
;; Map AT386 function key escape sequences
;; into the standard slots in function-keymap where we can;
;; set up terminal-specific bindings where we must
;;
;; by: JQB, adapted from s4.el
(require 'keypad)
;; First, map as many keys as possible to terminal-independent keycaps
(defvar META-RB-map nil
"The META-RB-map maps the ESC-[ function keys on the AT386 keyboard.")
(if (not META-RB-map)
(progn
(setq META-RB-map (lookup-key global-map "\e["))
(if (not (keymapp META-RB-map))
(setq META-RB-map (make-sparse-keymap))) ;; <ESC>[ commands
(setup-terminal-keymap META-RB-map '(
("A" . ?u) ; up arrow
("B" . ?d) ; down-arrow
("C" . ?r) ; right-arrow
("D" . ?l) ; left-arrow
("U" . ?N) ; 'Page' -> next page
("V" . ?P) ; 'Shift-Page' -> prev page
("H" . ?h) ; 'Home' -> home-key
("@" . ?I) ; 'Ins' -> insert character key
("G" . ?5) ; keypad 5
("S" . ?-) ; keypad -
("T" . ?+) ; keypad +
("Y" . ?n) ; 'End' (no standard, use n)
))
(global-set-key "\e[" META-RB-map)))
(defvar META-O-map nil
"META-O-map maps the META-O function keys on the AT386 keyboard.")
(if (not META-O-map)
(progn
(setq META-O-map (lookup-key global-map "\eO"))
(if (not (keymapp META-O-map))
(setq META-O-map (make-sparse-keymap))) ;; <ESC>O commands
(setup-terminal-keymap META-O-map '(
("P" . ?\C-a) ; 'F1' -> function key 1
("Q" . ?\C-b) ; 'F2' -> function key 2
("R" . ?\C-c) ; 'F3' -> function key 3
("S" . ?\C-d) ; 'F4' -> function key 4
("T" . ?\C-e) ; 'F5' -> function key 5
("U" . ?\C-f) ; 'F6' -> function key 6
("V" . ?\C-g) ; 'F7' -> function key 7
("W" . ?\C-h) ; 'F8' -> function key 8
("X" . ?\C-i) ; 'F9' -> function key 9
("Y" . ?\C-j) ; 'F10' -> function key 10
("Z" . ?\C-k) ; 'F11' -> function key 11
("A" . ?\C-l) ; 'F12' -> function key 12
))
(define-key global-map "\eO" META-O-map)))
More information about the Comp.unix.sysv386
mailing list