|
|
1.1 root 1: ;;; AT&T UnixPC keyboard definitions
2: ;;; Brant Cheikes ([email protected], manta!brant)
3: ;;; 4 August 1987
4: ;;;
5: ;;; Tested on: GNU Emacs 18.47.1 of Fri Jul 24 1987 on manta (usg-unix-v)
6: ;;;
7: ;;; The AT&T Unix PC (aka PC7300, 3B1) has a bizarre keyboard with
8: ;;; lots of interestingly labeled function keys. This file tries to
9: ;;; assign useful actions to the function keys. Note that the Shift
10: ;;; and Ctrl keys have the same effect on function keys, so Shift-F1
11: ;;; is the same as Ctrl-F1.
12: ;;;
13: ;;; Most of the information needed to create this file was taken from
14: ;;; documentation found in lisp/keypad.el
15: ;;;
16: ;;; Bug: The "Beg" and "End" (unshifted) keys are not supported because
17: ;;; they generate <esc>9 and <esc>0 respectively, and I know not how to
18: ;;; deal with them.
19:
20: (require 'keypad)
21:
22: ;;; There seem to be three prefixes for AT&T UnixPC function keys:
23: ;;; "<esc>O", "<esc>N", and "<esc>[". There seem to be a couple
24: ;;; keys that just generate "<esc><digit>".
25: ;;;
26: ;;; Note: for each mapping, I indicate the key on the Unix PC followed
27: ;;; by the Emacs command it is bound to (if any). Note that when I
28: ;;; couldn't figure out anything useful to do with a key, I simply bound
29: ;;; it to 'previous-line, arbitrarily. My goal was to get keys to do
30: ;;; "mnemonic" things.
31:
32: (defvar ATT-map-1 nil
33: "The bulk of the function keys on the AT&T Unix PC.")
34: (defvar ATT-map-2 nil
35: "A few other random function keys on the AT&T Unix PC.")
36: (defvar ATT-map-3 nil
37: "Some really random function keys on the AT&T Unix PC.")
38:
39: (defun enable-unixpc-keys ()
40: "Enable the use of the AT&T Unix PC function keys. Because of the
41: nature of the Unix PC, this unavoidably breaks several standard Emacs
42: prefixes; therefore, it is not done by default, but only if you give
43: this command."
44: (interactive)
45: (global-set-key "\eO" ATT-map-1)
46: (global-set-key "\eN" ATT-map-2)
47: (global-set-key "\e[" ATT-map-3))
48:
49: ;;; Create a few new keypad defaults. Here's what I think I'm doing here:
50: ;;; I look through "keypad.el" to find any unused entries in function-keymap
51: ;;; and then create my own bindings for them here. Then I use the newly
52: ;;; created ?x string in the setup-terminal-keymap.
53:
54: (keypad-default "2" 'advertised-undo)
55: (keypad-default "4" 'save-buffers-kill-emacs)
56: (keypad-default "5" 'save-buffer)
57: (keypad-default "6" 'beginning-of-buffer)
58: (keypad-default "8" 'end-of-buffer)
59: (keypad-default "w" 'kill-word)
60: (keypad-default "p" 'fill-paragraph)
61: (keypad-default "," 'copy-region-as-kill)
62:
63: (if ATT-map-1
64: nil
65: (setq ATT-map-1 (make-keymap)) ; <ESC>O commands
66: (setup-terminal-keymap ATT-map-1
67: '(("a" . ?\^d) ; Clear Line (kill-line)
68: ("A" . ?\^d) ; Shift-Clear Line (kill-line)
69: ("b" . ?u) ; Ref
70: ("B" . ?u) ; Rstrt
71: ("c" . ?u) ; F1
72: ("d" . ?u) ; F2
73: ("e" . ?u) ; F3
74: ("f" . ?u) ; F4
75: ("g" . ?u) ; F5
76: ("h" . ?u) ; F6
77: ("i" . ?u) ; F7
78: ("j" . ?u) ; F8
79: ("k" . ?4) ; Exit (save-buffers-kill-emacs)
80: ("K" . ?4) ; Shift-Exit (save-buffers-kill-emacs)
81: ("m" . ??) ; Help (help-command)
82: ("M" . ??) ; Shift-Help (help-command)
83: ("n" . ?u) ; Creat
84: ("N" . ?u) ; Shift-Creat
85: ("o" . ?5) ; Save (save-buffer)
86: ("O" . ?5) ; Shift-Save (save-buffer)
87: ("r" . ?u) ; Opts
88: ("R" . ?u) ; Shift-Opts
89: ("s" . ?2) ; Undo (advertised-undo)
90: ("S" . ?2) ; Shift-Undo (advertised-undo)
91: ("t" . ?p) ; Redo (fill-paragraph)
92: ("T" . ?p) ; Shift-Redo (fill-paragraph)
93: ("u" . ?u) ; Cmd
94: ("U" . ?u) ; Shift-Cmd
95: ("v" . ?e) ; Open (open-line)
96: ("V" . ?\^d) ; Close (kill-line)
97: ("w" . ?u) ; Cancl
98: ("W" . ?u) ; Shift-Cancl
99: ("x" . ?\^c) ; Find (isearch-forward)
100: ("X" . ?f) ; Shift-Find (re-search-forward)
101: ("y" . ?0) ; Rplac (yank)
102: ("Y" . ?0) ; Shift-Rplac (yank)
103: ("z" . ?u) ; Print
104: )))
105:
106: (if ATT-map-2
107: nil
108: (setq ATT-map-2 (make-keymap)) ; <ESC>N commands
109: (setup-terminal-keymap ATT-map-2
110: '(("a" . ?C) ; Rfrsh (recenter)
111: ("B" . ?6) ; Shift-Beg (beginning-of-buffer)
112: ("c" . ?0) ; Move (yank)
113: ("C" . ?0) ; Shift-Move (yank)
114: ("d" . ?,) ; Copy (copy-region-as-kill)
115: ("D" . ?,) ; Shift-Copy (copy-region-as-kill)
116: ("e" . ?k) ; Dlete (kill-region)
117: ("E" . ?k) ; Shift-Dlete (kill-region)
118: ("f" . ?.) ; Dlete Char (delete-char)
119: ("F" . ?w) ; Shift-Dlete Char (kill-word)
120: ("g" . ?P) ; Prev (scroll-down)
121: ("G" . ?P) ; Shift-Prev (scroll-down)
122: ("h" . ?N) ; Next (scroll-up)
123: ("H" . ?N) ; Shift-Next (scroll-up)
124: ("i" . ?s) ; Mark (set-mark-command)
125: ("I" . ?s) ; Slect (set-mark-command)
126: ("j" . ?u) ; Input Mode
127: ("J" . ?u) ; Shift-Input Mode
128: ("K" . ?1) ; Shift-LeftArrow (backward-word)
129: ("L" . ?3) ; Shift-RightArrow (forward-word)
130: ("M" . ?h) ; Shift-Home (move-to-window-line)
131: ("N" . ?8) ; Shift-End (end-of-buffer)
132: )))
133:
134: (if ATT-map-3
135: nil
136: (setq ATT-map-3 (make-keymap)) ; <ESC>[ commands
137: (setup-terminal-keymap ATT-map-3
138: '(("A" . ?u) ; Up Arrow (previous-line)
139: ("B" . ?d) ; Down Arrow (next-line)
140: ("C" . ?r) ; Right Arrow (forward-char)
141: ("D" . ?l) ; Left Arrow (backward-char)
142: ("H" . ?h) ; Home (move-to-window-line)
143: ("J" . ?C) ; Clear (recenter)
144: ("S" . ?9) ; Shift-DownArrow (forward-paragraph)
145: ("T" . ?7) ; Shift-UpArrow (backward-paragraph)
146: ("U" . ?N) ; Page (scroll-up)
147: ("V" . ?P) ; Shift-Page (scroll-down)
148: )))
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.