diff options
| author | Karl Heuer | 1995-02-08 01:25:15 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-02-08 01:25:15 +0000 |
| commit | c0e42a4d59686fdf32cfe511d76a8fca53f14881 (patch) | |
| tree | e9a644050ea2607bde5f956a8a5c854d30444628 | |
| parent | 3bef4fb92fd42b17724086b4dc9cee5a536a1afa (diff) | |
| download | emacs-c0e42a4d59686fdf32cfe511d76a8fca53f14881.tar.gz emacs-c0e42a4d59686fdf32cfe511d76a8fca53f14881.zip | |
Initial revision
| -rw-r--r-- | lisp/emulation/edt-lk201.el | 64 | ||||
| -rw-r--r-- | lisp/emulation/edt-mapper.el | 413 | ||||
| -rw-r--r-- | lisp/emulation/edt-pc.el | 93 | ||||
| -rw-r--r-- | lisp/emulation/edt-vt100.el | 54 |
4 files changed, 624 insertions, 0 deletions
diff --git a/lisp/emulation/edt-lk201.el b/lisp/emulation/edt-lk201.el new file mode 100644 index 00000000000..24bbc6a4f61 --- /dev/null +++ b/lisp/emulation/edt-lk201.el | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | ;;; File: edt-lk201.el --- Enhanced EDT Keypad Mode Emulation | ||
| 2 | ;;; for LK-201 Keyboards | ||
| 3 | ;;; | ||
| 4 | ;;; For GNU Emacs 19 | ||
| 5 | ;; | ||
| 6 | ;; Copyright (C) 1986 Free Software Foundation, Inc. | ||
| 7 | ;; Copyright (C) 1992, 1993 Kevin Gallagher | ||
| 8 | |||
| 9 | ;; Author: Kevin Gallagher <kgallagh@spd.dsccc.com> | ||
| 10 | ;; Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com> | ||
| 11 | ;; Keywords: emulations | ||
| 12 | |||
| 13 | ;; This file is NOT part of GNU Emacs but hopefully it will be soon. | ||
| 14 | |||
| 15 | ;; GNU Emacs is free software; you can redistribute it and/or modify | ||
| 16 | ;; it under the terms of the GNU General Public License as published by | ||
| 17 | ;; the Free Software Foundation; either version 2, or (at your option) | ||
| 18 | ;; any later version. | ||
| 19 | |||
| 20 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 21 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 22 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 23 | ;; GNU General Public License for more details. | ||
| 24 | |||
| 25 | ;; You should have received a copy of the GNU General Public License | ||
| 26 | ;; along with GNU Emacs; see the file COPYING. If not, write to | ||
| 27 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 28 | |||
| 29 | ;;; Usage: | ||
| 30 | |||
| 31 | ;; See edt-user.doc | ||
| 32 | |||
| 33 | ;; ==================================================================== | ||
| 34 | |||
| 35 | ;;; | ||
| 36 | ;;; Revision Information | ||
| 37 | ;;; | ||
| 38 | (defconst edt-lk201-revision "$Revision: 1.0 $" | ||
| 39 | "Revision Number of EDT LK-201 Keyboard Support.") | ||
| 40 | |||
| 41 | ;;;; | ||
| 42 | ;;;; KEY TRANSLATIONS | ||
| 43 | ;;;; | ||
| 44 | |||
| 45 | ;; Associate EDT keynames with Emacs terminal function vector names. | ||
| 46 | ;; (Function key vector names for LK-201 are found in lisp/term/lk201.el.) | ||
| 47 | ;; | ||
| 48 | ;; F1 - F5 are not available on many DEC VT series terminals. | ||
| 49 | ;; However, this is not always the case. So support for F1 - F5 is | ||
| 50 | ;; provided here and in lisp/term/lk201.el. | ||
| 51 | (defconst *EDT-keys* | ||
| 52 | '(("KP0" . [kp-0]) ("KP1" . [kp-1]) ("KP2" . [kp-2]) ("KP3" . [kp-3]) | ||
| 53 | ("KP4" . [kp-4]) ("KP5" . [kp-5]) ("KP6" . [kp-6]) ("KP7" . [kp-7]) | ||
| 54 | ("KP8" . [kp-8]) ("KP9" . [kp-9]) ("KP," . [kp-separator]) | ||
| 55 | ("KP-" . [kp-subtract]) ("KPP" . [kp-decimal]) ("KPE" . [kp-enter]) | ||
| 56 | ("PF1" . [kp-f1]) ("PF2" . [kp-f2]) ("PF3" . [kp-f3]) ("PF4" . [kp-f4]) | ||
| 57 | ("UP" . [up]) ("DOWN" . [down]) ("RIGHT" . [right]) ("LEFT" . [left]) | ||
| 58 | ("FIND" . [find]) ("INSERT" . [insert]) ("REMOVE" . [delete]) | ||
| 59 | ("SELECT" . [select]) ("PREVIOUS" . [prior]) ("NEXT" . [next]) | ||
| 60 | ("F1" . [f1]) ("F2" . [f2]) ("F3" . [f3]) ("F4" . [f4]) ("F5" . [f5]) | ||
| 61 | ("F6" . [f6]) ("F7" . [f7]) ("F8" . [f8]) ("F9" . [f9]) ("F10" . [f10]) | ||
| 62 | ("F11" . [f11]) ("F12" . [f12]) ("F13" . [f13]) ("F14" . [f14]) | ||
| 63 | ("HELP" . [help]) ("DO" . [menu]) ("F17" . [f17]) ("F18" . [f18]) | ||
| 64 | ("F19" . [f19]) ("F20" . [f20]))) | ||
diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el new file mode 100644 index 00000000000..14fb6337273 --- /dev/null +++ b/lisp/emulation/edt-mapper.el | |||
| @@ -0,0 +1,413 @@ | |||
| 1 | ;;; edt-mapper.el --- Create an EDT LK-201 Map File for X-Windows Emacs. | ||
| 2 | |||
| 3 | ;;; For GNU Emacs 19 | ||
| 4 | |||
| 5 | ;; Copyright (C) 1994 Kevin Gallagher | ||
| 6 | |||
| 7 | ;; Author: Kevin Gallagher <kgallagh@spd.dsccc.com> | ||
| 8 | ;; Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com> | ||
| 9 | ;; Keywords: emulations | ||
| 10 | |||
| 11 | ;; This file is NOT part of GNU Emacs but hopefully it will be soon. | ||
| 12 | |||
| 13 | ;; GNU Emacs is free software; you can redistribute it and/or modify | ||
| 14 | ;; it under the terms of the GNU General Public License as published by | ||
| 15 | ;; the Free Software Foundation; either version 2, or (at your option) | ||
| 16 | ;; any later version. | ||
| 17 | |||
| 18 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 19 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 20 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 21 | ;; GNU General Public License for more details. | ||
| 22 | |||
| 23 | ;; You should have received a copy of the GNU General Public License | ||
| 24 | ;; along with GNU Emacs; see the file COPYING. If not, write to | ||
| 25 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 26 | |||
| 27 | ;;; Commentary: | ||
| 28 | |||
| 29 | ;; This emacs lisp program can be used to create an emacs lisp file | ||
| 30 | ;; that defines the mapping of the user's keyboard under X-Windows to | ||
| 31 | ;; the LK-201 keyboard function keys and keypad keys (around which | ||
| 32 | ;; EDT has been designed). Please read the "Usage" AND "Known | ||
| 33 | ;; Problems" sections before attempting to run this program. (The | ||
| 34 | ;; design of this file, edt-mapper.el, was heavily influenced by | ||
| 35 | ;; tpu-mapper.el.) | ||
| 36 | |||
| 37 | ;;; Usage: | ||
| 38 | |||
| 39 | ;; Simply load this file into the X-Windows version of emacs (version 19) | ||
| 40 | ;; using the following command. | ||
| 41 | |||
| 42 | ;; emacs -q -l edt-mapper.el | ||
| 43 | |||
| 44 | ;; The "-q" option prevents loading of your .emacs file (commands therein | ||
| 45 | ;; might confuse this program). | ||
| 46 | |||
| 47 | ;; An instruction screen showing the typical LK-201 terminal functions keys | ||
| 48 | ;; will be displayed, and you will be prompted to press the keys on your | ||
| 49 | ;; keyboard which you want to emulate the corresponding LK-201 keys. | ||
| 50 | |||
| 51 | ;; Finally, you will be prompted for the name of the file to store | ||
| 52 | ;; the key definitions. If you chose the default, it will be found | ||
| 53 | ;; and loaded automatically when the EDT emulation is started. If | ||
| 54 | ;; you specify a different file name, you will need to set the | ||
| 55 | ;; variable "edt-xkeys-file" before starting the EDT emulation. | ||
| 56 | ;; Here's how you might go about doing that in your .emacs file. | ||
| 57 | |||
| 58 | ;; (setq edt-xkeys-file (expand-file-name "~/.my-emacs-x-keys")) | ||
| 59 | |||
| 60 | ;;; Known Problems: | ||
| 61 | |||
| 62 | ;; Sometimes, edt-mapper will ignore a key you press, and just continue to | ||
| 63 | ;; prompt for the same key. This can happen when your window manager sucks | ||
| 64 | ;; up the key and doesn't pass it on to emacs, or it could be an emacs bug. | ||
| 65 | ;; Either way, there's nothing that edt-mapper can do about it. You must | ||
| 66 | ;; press RETURN, to skip the current key and continue. Later, you and/or | ||
| 67 | ;; your local X guru can try to figure out why the key is being ignored. | ||
| 68 | |||
| 69 | ;; ==================================================================== | ||
| 70 | |||
| 71 | ;;; | ||
| 72 | ;;; Revision Information | ||
| 73 | ;;; | ||
| 74 | (defconst edt-mapper-revision "$Revision: 1.0 $" | ||
| 75 | "Revision Number of EDT X-Windows Emacs Key Mapper.") | ||
| 76 | |||
| 77 | |||
| 78 | ;;; | ||
| 79 | ;;; Make sure we're running X-windows and Emacs version 19 | ||
| 80 | ;;; | ||
| 81 | (cond | ||
| 82 | ((not (and window-system (not (string-lessp emacs-version "19")))) | ||
| 83 | (insert " | ||
| 84 | |||
| 85 | Whoa! This isn't going to work... | ||
| 86 | |||
| 87 | You must run edt-mapper.el under X-windows and Emacs version 19. | ||
| 88 | |||
| 89 | Press any key to exit. ") | ||
| 90 | (sit-for 600) | ||
| 91 | (kill-emacs t))) | ||
| 92 | |||
| 93 | |||
| 94 | ;;; | ||
| 95 | ;;; Decide whether we're running GNU or Lucid emacs. | ||
| 96 | ;;; | ||
| 97 | (defconst edt-lucid-emacs19-p (string-match "Lucid" emacs-version) | ||
| 98 | "Non-NIL if we are running Lucid Emacs version 19.") | ||
| 99 | |||
| 100 | |||
| 101 | ;;; | ||
| 102 | ;;; Key variables | ||
| 103 | ;;; | ||
| 104 | (defvar edt-key nil) | ||
| 105 | (defvar edt-enter nil) | ||
| 106 | (defvar edt-return nil) | ||
| 107 | (defvar edt-key-seq nil) | ||
| 108 | (defvar edt-enter-seq nil) | ||
| 109 | (defvar edt-return-seq nil) | ||
| 110 | |||
| 111 | |||
| 112 | ;;; | ||
| 113 | ;;; Make sure the window is big enough to display the instructions | ||
| 114 | ;;; | ||
| 115 | (if edt-lucid-emacs19-p (set-screen-size nil 80 36) | ||
| 116 | (set-frame-size (selected-frame) 80 36)) | ||
| 117 | |||
| 118 | |||
| 119 | ;;; | ||
| 120 | ;;; Create buffers - Directions and Keys | ||
| 121 | ;;; | ||
| 122 | (if (not (get-buffer "Directions")) (generate-new-buffer "Directions")) | ||
| 123 | (if (not (get-buffer "Keys")) (generate-new-buffer "Keys")) | ||
| 124 | |||
| 125 | ;;; | ||
| 126 | ;;; Put header in the Keys buffer | ||
| 127 | ;;; | ||
| 128 | (set-buffer "Keys") | ||
| 129 | (insert "\ | ||
| 130 | ;; | ||
| 131 | ;; Key definitions for the EDT emulation within GNU Emacs | ||
| 132 | ;; | ||
| 133 | |||
| 134 | (defconst *EDT-keys* | ||
| 135 | '( | ||
| 136 | ") | ||
| 137 | |||
| 138 | ;;; | ||
| 139 | ;;; Display directions | ||
| 140 | ;;; | ||
| 141 | (switch-to-buffer "Directions") | ||
| 142 | (insert " | ||
| 143 | EDT MAPPER | ||
| 144 | |||
| 145 | You will be asked to press keys to create a custom mapping (under | ||
| 146 | X-Windows) of your keypad keys and function keys so that they can emulate | ||
| 147 | the LK-201 keypad and function keys or the subset of keys found on a | ||
| 148 | VT-100 series terminal keyboard. (The LK-201 keyboard is the standard | ||
| 149 | keyboard attached to VT-200 series terminals, and above.) | ||
| 150 | |||
| 151 | Sometimes, edt-mapper will ignore a key you press, and just continue to | ||
| 152 | prompt for the same key. This can happen when your window manager sucks | ||
| 153 | up the key and doesn't pass it on to emacs, or it could be an emacs bug. | ||
| 154 | Either way, there's nothing that edt-mapper can do about it. You must | ||
| 155 | press RETURN, to skip the current key and continue. Later, you and/or | ||
| 156 | your local X guru can try to figure out why the key is being ignored. | ||
| 157 | |||
| 158 | Start by pressing the RETURN key, and continue by pressing the keys | ||
| 159 | specified in the mini-buffer. If you want to entirely omit a key, | ||
| 160 | because your keyboard does not have a corresponding key, for example, | ||
| 161 | just press RETURN at the prompt. | ||
| 162 | |||
| 163 | ") | ||
| 164 | (delete-other-windows) | ||
| 165 | |||
| 166 | ;;; | ||
| 167 | ;;; Save <CR> for future reference | ||
| 168 | ;;; | ||
| 169 | (cond | ||
| 170 | (edt-lucid-emacs19-p | ||
| 171 | (setq edt-return-seq (read-key-sequence "Hit carriage-return <CR> to continue ")) | ||
| 172 | (setq edt-return (concat "[" (format "%s" (event-key (aref edt-return-seq 0))) "]"))) | ||
| 173 | (t | ||
| 174 | (message "Hit carriage-return <CR> to continue ") | ||
| 175 | (setq edt-return-seq (read-event)) | ||
| 176 | (setq edt-return (concat "[" (format "%s" edt-return-seq) "]")))) | ||
| 177 | |||
| 178 | ;;; | ||
| 179 | ;;; Display Keypad Diagram and Begin Prompting for Keys | ||
| 180 | ;;; | ||
| 181 | (set-buffer "Directions") | ||
| 182 | (delete-region (point-min) (point-max)) | ||
| 183 | (insert " | ||
| 184 | |||
| 185 | |||
| 186 | |||
| 187 | PRESS THE KEY SPECIFIED IN THE MINIBUFFER BELOW. | ||
| 188 | |||
| 189 | |||
| 190 | |||
| 191 | |||
| 192 | Here's a picture of the standard LK-201 keypad for reference: | ||
| 193 | |||
| 194 | _______________________ _______________________________ | ||
| 195 | | HELP | DO | | F17 | F18 | F19 | F20 | | ||
| 196 | | | | | | | | | | ||
| 197 | |_______|_______________| |_______|_______|_______|_______| | ||
| 198 | _______________________ _______________________________ | ||
| 199 | | FIND |INSERT |REMOVE | | PF1 | PF2 | PF3 | PF4 | | ||
| 200 | | | | | | | | | | | ||
| 201 | |_______|_______|_______| |_______|_______|_______|_______| | ||
| 202 | |SELECT |PREVIOU| NEXT | | KP7 | KP8 | KP9 | KP- | | ||
| 203 | | | | | | | | | | | ||
| 204 | |_______|_______|_______| |_______|_______|_______|_______| | ||
| 205 | | UP | | KP4 | KP5 | KP6 | KP, | | ||
| 206 | | | | | | | | | ||
| 207 | _______|_______|_______ |_______|_______|_______|_______| | ||
| 208 | | LEFT | DOWN | RIGHT | | KP1 | KP2 | KP3 | | | ||
| 209 | | | | | | | | | | | ||
| 210 | |_______|_______|_______| |_______|_______|_______| KPE | | ||
| 211 | | KP0 | KPP | | | ||
| 212 | | | | | | ||
| 213 | |_______________|_______|_______| | ||
| 214 | |||
| 215 | ") | ||
| 216 | |||
| 217 | ;;; | ||
| 218 | ;;; Key mapping functions | ||
| 219 | ;;; | ||
| 220 | (defun edt-lucid-map-key (ident descrip func gold-func) | ||
| 221 | (interactive) | ||
| 222 | (setq edt-key-seq (read-key-sequence (format "Press %s%s: " ident descrip))) | ||
| 223 | (setq edt-key (concat "[" (format "%s" (event-key (aref edt-key-seq 0))) "]")) | ||
| 224 | (cond ((not (equal edt-key edt-return)) | ||
| 225 | (set-buffer "Keys") | ||
| 226 | (insert (format " (\"%s\" . %s)\n" ident edt-key)) | ||
| 227 | (set-buffer "Directions")) | ||
| 228 | ;; bogosity to get next prompt to come up, if the user hits <CR>! | ||
| 229 | ;; check periodically to see if this is still needed... | ||
| 230 | (t | ||
| 231 | (format "%s" edt-key))) | ||
| 232 | edt-key) | ||
| 233 | |||
| 234 | (defun edt-gnu-map-key (ident descrip) | ||
| 235 | (interactive) | ||
| 236 | (message "Press %s%s: " ident descrip) | ||
| 237 | (setq edt-key-seq (read-event)) | ||
| 238 | (setq edt-key (concat "[" (format "%s" edt-key-seq) "]")) | ||
| 239 | (cond ((not (equal edt-key edt-return)) | ||
| 240 | (set-buffer "Keys") | ||
| 241 | (insert (format " (\"%s\" . %s)\n" ident edt-key)) | ||
| 242 | (set-buffer "Directions")) | ||
| 243 | ;; bogosity to get next prompt to come up, if the user hits <CR>! | ||
| 244 | ;; check periodically to see if this is still needed... | ||
| 245 | (t | ||
| 246 | (set-buffer "Keys") | ||
| 247 | (insert (format " (\"%s\" . \"\" )\n" ident)) | ||
| 248 | (set-buffer "Directions"))) | ||
| 249 | edt-key) | ||
| 250 | |||
| 251 | (fset 'edt-map-key (if edt-lucid-emacs19-p 'edt-lucid-map-key 'edt-gnu-map-key)) | ||
| 252 | (set-buffer "Keys") | ||
| 253 | (insert " | ||
| 254 | ;; | ||
| 255 | ;; Arrows | ||
| 256 | ;; | ||
| 257 | ") | ||
| 258 | (set-buffer "Directions") | ||
| 259 | |||
| 260 | (edt-map-key "UP" " - The Up Arrow Key") | ||
| 261 | (edt-map-key "DOWN" " - The Down Arrow Key") | ||
| 262 | (edt-map-key "LEFT" " - The Left Arrow Key") | ||
| 263 | (edt-map-key "RIGHT" " - The Right Arrow Key") | ||
| 264 | |||
| 265 | |||
| 266 | (set-buffer "Keys") | ||
| 267 | (insert " | ||
| 268 | ;; | ||
| 269 | ;; PF keys | ||
| 270 | ;; | ||
| 271 | ") | ||
| 272 | (set-buffer "Directions") | ||
| 273 | |||
| 274 | (edt-map-key "PF1" " - The PF1 (GOLD) Key") | ||
| 275 | (edt-map-key "PF2" " - The Keypad PF2 Key") | ||
| 276 | (edt-map-key "PF3" " - The Keypad PF3 Key") | ||
| 277 | (edt-map-key "PF4" " - The Keypad PF4 Key") | ||
| 278 | |||
| 279 | (set-buffer "Keys") | ||
| 280 | (insert " | ||
| 281 | ;; | ||
| 282 | ;; KP0-9 KP- KP, KPP and KPE | ||
| 283 | ;; | ||
| 284 | ") | ||
| 285 | (set-buffer "Directions") | ||
| 286 | |||
| 287 | (edt-map-key "KP0" " - The Keypad 0 Key") | ||
| 288 | (edt-map-key "KP1" " - The Keypad 1 Key") | ||
| 289 | (edt-map-key "KP2" " - The Keypad 2 Key") | ||
| 290 | (edt-map-key "KP3" " - The Keypad 3 Key") | ||
| 291 | (edt-map-key "KP4" " - The Keypad 4 Key") | ||
| 292 | (edt-map-key "KP5" " - The Keypad 5 Key") | ||
| 293 | (edt-map-key "KP6" " - The Keypad 6 Key") | ||
| 294 | (edt-map-key "KP7" " - The Keypad 7 Key") | ||
| 295 | (edt-map-key "KP8" " - The Keypad 8 Key") | ||
| 296 | (edt-map-key "KP9" " - The Keypad 9 Key") | ||
| 297 | (edt-map-key "KP-" " - The Keypad - Key") | ||
| 298 | (edt-map-key "KP," " - The Keypad , Key") | ||
| 299 | (edt-map-key "KPP" " - The Keypad . Key") | ||
| 300 | (edt-map-key "KPE" " - The Keypad Enter Key") | ||
| 301 | ;; Save the enter key | ||
| 302 | (setq edt-enter edt-key) | ||
| 303 | (setq edt-enter-seq edt-key-seq) | ||
| 304 | |||
| 305 | |||
| 306 | (set-buffer "Keys") | ||
| 307 | (insert " | ||
| 308 | ;; | ||
| 309 | ;; Editing keypad (FIND, INSERT, REMOVE) | ||
| 310 | ;; (SELECT, PREVIOUS, NEXT) | ||
| 311 | ;; | ||
| 312 | ") | ||
| 313 | (set-buffer "Directions") | ||
| 314 | |||
| 315 | (edt-map-key "FIND" " - The Find key on the editing keypad") | ||
| 316 | (edt-map-key "INSERT" " - The Insert key on the editing keypad") | ||
| 317 | (edt-map-key "REMOVE" " - The Remove key on the editing keypad") | ||
| 318 | (edt-map-key "SELECT" " - The Select key on the editing keypad") | ||
| 319 | (edt-map-key "PREVIOUS" " - The Prev Scr key on the editing keypad") | ||
| 320 | (edt-map-key "NEXT" " - The Next Scr key on the editing keypad") | ||
| 321 | |||
| 322 | (set-buffer "Keys") | ||
| 323 | (insert " | ||
| 324 | ;; | ||
| 325 | ;; F1-14 Help Do F17-F20 | ||
| 326 | ;; | ||
| 327 | ") | ||
| 328 | (set-buffer "Directions") | ||
| 329 | |||
| 330 | (edt-map-key "F1" " - F1 Function Key") | ||
| 331 | (edt-map-key "F2" " - F2 Function Key") | ||
| 332 | (edt-map-key "F3" " - F3 Function Key") | ||
| 333 | (edt-map-key "F4" " - F4 Function Key") | ||
| 334 | (edt-map-key "F5" " - F5 Function Key") | ||
| 335 | (edt-map-key "F6" " - F6 Function Key") | ||
| 336 | (edt-map-key "F7" " - F7 Function Key") | ||
| 337 | (edt-map-key "F8" " - F8 Function Key") | ||
| 338 | (edt-map-key "F9" " - F9 Function Key") | ||
| 339 | (edt-map-key "F10" " - F10 Function Key") | ||
| 340 | (edt-map-key "F11" " - F11 Function Key") | ||
| 341 | (edt-map-key "F12" " - F12 Function Key") | ||
| 342 | (edt-map-key "F13" " - F13 Function Key") | ||
| 343 | (edt-map-key "F14" " - F14 Function Key") | ||
| 344 | (edt-map-key "HELP" " - HELP Function Key") | ||
| 345 | (edt-map-key "DO" " - DO Function Key") | ||
| 346 | (edt-map-key "F17" " - F17 Function Key") | ||
| 347 | (edt-map-key "F18" " - F18 Function Key") | ||
| 348 | (edt-map-key "F19" " - F19 Function Key") | ||
| 349 | (edt-map-key "F20" " - F20 Function Key") | ||
| 350 | |||
| 351 | (set-buffer "Directions") | ||
| 352 | (delete-region (point-min) (point-max)) | ||
| 353 | (insert " | ||
| 354 | ADDITIONAL FUNCTION KEYS | ||
| 355 | |||
| 356 | Your keyboard may have additional function keys which do not | ||
| 357 | correspond to any LK-201 keys. The EDT Emulation can be | ||
| 358 | configured to recognize those keys, since you may wish to add your | ||
| 359 | own key bindings to those keys. | ||
| 360 | |||
| 361 | For example, suppose your keyboard has a keycap marked \"Line Del\" | ||
| 362 | and you wish to add it to the list of keys which can be customized | ||
| 363 | by the EDT Emulation. First, assign a unique single-word name to | ||
| 364 | the key for use by the EDT Emulation, let's say \"linedel\", in this | ||
| 365 | example. Then, at the \"EDT Key Name:\" prompt, enter \"linedel\", | ||
| 366 | followed by a press of the RETURN key. Finally, when prompted, | ||
| 367 | press the \"Line Del\" key. You now will be able to bind functions | ||
| 368 | to \"linedel\" and \"Gold-linedel\" in edt-user.el in just the same way | ||
| 369 | you can customize bindings of the standard LK-201 keys. | ||
| 370 | |||
| 371 | When you have no additional function keys to specify, just press | ||
| 372 | RETURN at the \"EDT Key Name:\" prompt. (If you change your mind | ||
| 373 | AFTER you enter an EDT Key Name and before you press a key at the | ||
| 374 | \"Press\" prompt, you may omit the key by simply pressing RETURN at | ||
| 375 | the prompt.) | ||
| 376 | ") | ||
| 377 | (switch-to-buffer "Directions") | ||
| 378 | ;;; | ||
| 379 | ;;; Add support for extras keys | ||
| 380 | ;;; | ||
| 381 | (set-buffer "Keys") | ||
| 382 | (insert "\ | ||
| 383 | ;; | ||
| 384 | ;; Extra Keys | ||
| 385 | ;; | ||
| 386 | ") | ||
| 387 | (setq EDT-key-name "") | ||
| 388 | (while (not | ||
| 389 | (string-equal (setq EDT-key-name (read-string "EDT Key Name: ")) "")) | ||
| 390 | (edt-map-key EDT-key-name "")) | ||
| 391 | |||
| 392 | ; | ||
| 393 | ; No more keys to add, so wrap up. | ||
| 394 | ; | ||
| 395 | (set-buffer "Keys") | ||
| 396 | (insert "\ | ||
| 397 | ) | ||
| 398 | ) | ||
| 399 | ") | ||
| 400 | |||
| 401 | ;;; | ||
| 402 | ;;; Save the key mapping program and blow this pop stand | ||
| 403 | ;;; | ||
| 404 | (let ((file (if edt-lucid-emacs19-p "~/.edt-lucid-keys" "~/.edt-gnu-keys"))) | ||
| 405 | (set-visited-file-name | ||
| 406 | (read-file-name (format "Save key mapping to file (default %s): " file) nil file))) | ||
| 407 | (save-buffer) | ||
| 408 | |||
| 409 | (message "That's it! Press any key to exit") | ||
| 410 | (sit-for 600) | ||
| 411 | (kill-emacs t) | ||
| 412 | |||
| 413 | ;;; edt-mapper.el ends here | ||
diff --git a/lisp/emulation/edt-pc.el b/lisp/emulation/edt-pc.el new file mode 100644 index 00000000000..7fb600741fd --- /dev/null +++ b/lisp/emulation/edt-pc.el | |||
| @@ -0,0 +1,93 @@ | |||
| 1 | ;;; File: edt-pc.el --- Enhanced EDT Keypad Mode Emulation | ||
| 2 | ;;; for PC 101 Keyboards | ||
| 3 | ;;; | ||
| 4 | ;;; For GNU Emacs 19 | ||
| 5 | ;; | ||
| 6 | ;; Copyright (C) 1986, 1994 Free Software Foundation, Inc. | ||
| 7 | |||
| 8 | ;; Author: Kevin Gallagher <kgallagh@spd.dsccc.com> | ||
| 9 | ;; Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com> | ||
| 10 | ;; Keywords: emulations | ||
| 11 | |||
| 12 | ;; This file is part of GNU Emacs. | ||
| 13 | |||
| 14 | ;; GNU Emacs is free software; you can redistribute it and/or modify | ||
| 15 | ;; it under the terms of the GNU General Public License as published by | ||
| 16 | ;; the Free Software Foundation; either version 2, or (at your option) | ||
| 17 | ;; any later version. | ||
| 18 | |||
| 19 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 20 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | ;; GNU General Public License for more details. | ||
| 23 | |||
| 24 | ;; You should have received a copy of the GNU General Public License | ||
| 25 | ;; along with GNU Emacs; see the file COPYING. If not, write to | ||
| 26 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 27 | |||
| 28 | ;;; Usage: | ||
| 29 | |||
| 30 | ;; See edt-user.doc | ||
| 31 | |||
| 32 | ;; ==================================================================== | ||
| 33 | |||
| 34 | ;;; | ||
| 35 | ;;; Revision Information | ||
| 36 | ;;; | ||
| 37 | (defconst edt-pc-revision "$Revision: 1.0 $" | ||
| 38 | "Revision Number of EDT PC 101 Keyboard Support.") | ||
| 39 | |||
| 40 | ;;;; | ||
| 41 | ;;;; KEY TRANSLATIONS | ||
| 42 | ;;;; | ||
| 43 | |||
| 44 | ;; Associate EDT keynames with Emacs terminal function vector names. | ||
| 45 | ;; | ||
| 46 | ;; To emulate the DEC LK-201 keypad keys on the PC 101 keyboard, | ||
| 47 | ;; NumLock must be ON. | ||
| 48 | ;; | ||
| 49 | ;; The PC keypad keys are mapped to the corresponding DEC LK-201 | ||
| 50 | ;; keypad keys according to the corresponding physical possition on | ||
| 51 | ;; the keyboard. Thus, the physical position of the PC keypad key | ||
| 52 | ;; determines its function, not the PC keycap name. | ||
| 53 | ;; | ||
| 54 | ;; There are two LK-201 keypad keys needing special handling: PF1 and | ||
| 55 | ;; the keypad comma key. | ||
| 56 | ;; | ||
| 57 | ;; PF1: | ||
| 58 | ;; Most PC software does not see a press of the NumLock key. A TSR | ||
| 59 | ;; program distributed with MS-Kermit to support its VT-100 emulation | ||
| 60 | ;; solves this problem. The TSR, called GOLD, causes a press of the | ||
| 61 | ;; keypad NumLock key to look as if the PC F1 key were pressed. So | ||
| 62 | ;; the PC F1 key is mapped here to behave as the PF1 (GOLD) key. | ||
| 63 | ;; Then with GOLD loaded, the NumLock key will behave as the GOLD key. | ||
| 64 | ;; | ||
| 65 | ;; By the way, with GOLD loaded, you can still toggle numlock on/off. | ||
| 66 | ;; GOLD binds this to Shift-NumLock. | ||
| 67 | ;; | ||
| 68 | ;; Keypad Comma: | ||
| 69 | ;; There is no physical PC keypad key to correspond to the LK-201 | ||
| 70 | ;; keypad comma key. So, the EDT Emulation is configured below to | ||
| 71 | ;; ignore attempts to bind functions to the keypad comma key. | ||
| 72 | ;; | ||
| 73 | ;; Finally, F2 through F12 are also available for making key bindings | ||
| 74 | ;; in the EDT Emulation on the PC. F1 is reserved for the GOLD key, | ||
| 75 | ;; so don't attempt to bind anything to it. Also, F13, F14, HELP, DO, | ||
| 76 | ;; and F17 through F20 do not exist on the PC, so the EDT emulation is | ||
| 77 | ;; configured below to ignore attempts to bind functions to those keys. | ||
| 78 | ;; | ||
| 79 | (defconst *EDT-keys* | ||
| 80 | '(("KP0" . [kp-0]) ("KP1" . [kp-1]) ("KP2" . [kp-2]) ("KP3" . [kp-3]) | ||
| 81 | ("KP4" . [kp-4]) ("KP5" . [kp-5]) ("KP6" . [kp-6]) ("KP7" . [kp-7]) | ||
| 82 | ("KP8" . [kp-8]) ("KP9" . [kp-9]) ("KP," . "" ) | ||
| 83 | ("KP-" . [kp-add]) ("KPP" . [kp-decimal]) ("KPE" . [kp-enter]) | ||
| 84 | ("PF1" . [f1]) ("PF2" . [kp-divide]) ("PF3" . [kp-multiply]) | ||
| 85 | ("PF4" . [kp-subtract]) | ||
| 86 | ("UP" . [up]) ("DOWN" . [down]) ("RIGHT" . [right]) ("LEFT" . [left]) | ||
| 87 | ("FIND" . [insert]) ("INSERT" . [home]) ("REMOVE" . [prior]) | ||
| 88 | ("SELECT" . [delete]) ("PREVIOUS" . [end]) ("NEXT" . [next]) | ||
| 89 | ("F1" . "" ) ("F2" . [f2]) ("F3" . [f3]) ("F4" . [f4]) ("F5" . [f5]) | ||
| 90 | ("F6" . [f6]) ("F7" . [f7]) ("F8" . [f8]) ("F9" . [f9]) ("F10" . [f10]) | ||
| 91 | ("F11" . [f11]) ("F12" . [f12]) ("F13" . "" ) ("F14" . "" ) | ||
| 92 | ("HELP" . "" ) ("DO" . "" ) ("F17" . "" ) ("F18" . "" ) | ||
| 93 | ("F19" . "" ) ("F20" . "" ))) | ||
diff --git a/lisp/emulation/edt-vt100.el b/lisp/emulation/edt-vt100.el new file mode 100644 index 00000000000..c679f8c253b --- /dev/null +++ b/lisp/emulation/edt-vt100.el | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | ;;; File: edt-vt100.el --- Enhanced EDT Keypad Mode Emulation | ||
| 2 | ;;; for VT Series Terminals | ||
| 3 | ;;; | ||
| 4 | ;;; For GNU Emacs 19 | ||
| 5 | ;;; | ||
| 6 | ;; | ||
| 7 | ;; Copyright (C) 1986, 1992, 1993 Free Software Foundation, Inc. | ||
| 8 | |||
| 9 | ;; Author: Kevin Gallagher <kgallagh@spd.dsccc.com> | ||
| 10 | ;; Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com> | ||
| 11 | ;; Keywords: emulations | ||
| 12 | |||
| 13 | ;; This file is part of GNU Emacs. | ||
| 14 | |||
| 15 | ;; GNU Emacs is free software; you can redistribute it and/or modify | ||
| 16 | ;; it under the terms of the GNU General Public License as published by | ||
| 17 | ;; the Free Software Foundation; either version 2, or (at your option) | ||
| 18 | ;; any later version. | ||
| 19 | |||
| 20 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 21 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 22 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 23 | ;; GNU General Public License for more details. | ||
| 24 | |||
| 25 | ;; You should have received a copy of the GNU General Public License | ||
| 26 | ;; along with GNU Emacs; see the file COPYING. If not, write to | ||
| 27 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 28 | |||
| 29 | ;;; Usage: | ||
| 30 | |||
| 31 | ;; See edt-user.doc | ||
| 32 | |||
| 33 | ;; ==================================================================== | ||
| 34 | |||
| 35 | ;;; | ||
| 36 | ;;; Revision Information | ||
| 37 | ;;; | ||
| 38 | (defconst edt-vt100-revision "$Revision: 1.0.1 $" | ||
| 39 | "Revision Number of EDT VT Series Terminal Support.") | ||
| 40 | |||
| 41 | ;; Get keyboard function key mapping to EDT keys. | ||
| 42 | (load "edt-lk201" nil t) | ||
| 43 | |||
| 44 | (defun edt-set-screen-width-80 () | ||
| 45 | "Set screen width to 80 columns." | ||
| 46 | (interactive) | ||
| 47 | (vt100-wide-mode -1) | ||
| 48 | (message "Screen width 80")) | ||
| 49 | |||
| 50 | (defun edt-set-screen-width-132 () | ||
| 51 | "Set screen width to 132 columns." | ||
| 52 | (interactive) | ||
| 53 | (vt100-wide-mode 1) | ||
| 54 | (message "Screen width 132")) | ||