| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
(cond |
|---|
| 106 |
((string-lessp emacs-version "19") |
|---|
| 107 |
(insert " |
|---|
| 108 |
|
|---|
| 109 |
Whoa! This isn't going to work... |
|---|
| 110 |
|
|---|
| 111 |
You must run edt-mapper.el under Emacs version 19 or higher. |
|---|
| 112 |
|
|---|
| 113 |
Press any key to exit. ") |
|---|
| 114 |
(sit-for 600) |
|---|
| 115 |
(kill-emacs t))) |
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
(defconst edt-x-emacs-p (string-match "XEmacs" emacs-version) |
|---|
| 122 |
"Non-nil if we are running XEmacs version 19, or higher.") |
|---|
| 123 |
|
|---|
| 124 |
(defconst edt-emacs-variant (if edt-x-emacs-p "xemacs" "gnu") |
|---|
| 125 |
"Indicates Emacs variant: GNU Emacs or XEmacs \(aka Lucid Emacs\).") |
|---|
| 126 |
|
|---|
| 127 |
(defconst edt-window-system (if edt-x-emacs-p (console-type) window-system) |
|---|
| 128 |
"Indicates window system \(in GNU Emacs\) or console type \(in XEmacs\).") |
|---|
| 129 |
|
|---|
| 130 |
(defconst edt-xserver (if (eq edt-window-system 'x) |
|---|
| 131 |
(if edt-x-emacs-p |
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 |
(replace-in-string (x-server-vendor) "[ /]" "-") |
|---|
| 137 |
(subst-char-in-string ?/ ?- (subst-char-in-string ? ?- (x-server-vendor)))) |
|---|
| 138 |
nil) |
|---|
| 139 |
"Indicates X server vendor name, if applicable.") |
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 |
(defvar edt-key nil) |
|---|
| 146 |
(defvar edt-enter nil) |
|---|
| 147 |
(defvar edt-return nil) |
|---|
| 148 |
(defvar edt-key-seq nil) |
|---|
| 149 |
(defvar edt-enter-seq nil) |
|---|
| 150 |
(defvar edt-return-seq nil) |
|---|
| 151 |
(defvar edt-term nil) |
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 |
(eval-when-compile |
|---|
| 155 |
(defvar EDT-key-name) |
|---|
| 156 |
(defvar edt-save-function-key-map)) |
|---|
| 157 |
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
(if (and edt-window-system (not (eq edt-window-system 'tty))) |
|---|
| 163 |
(setq edt-term nil) |
|---|
| 164 |
(setq edt-term (getenv "TERM"))) |
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
(if (and edt-window-system (not (eq edt-window-system 'tty))) |
|---|
| 172 |
(set-frame-size (selected-frame) 80 36)) |
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
|
|---|
| 176 |
|
|---|
| 177 |
(if (not (get-buffer "Directions")) (generate-new-buffer "Directions")) |
|---|
| 178 |
(if (not (get-buffer "Keys")) (generate-new-buffer "Keys")) |
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 |
|
|---|
| 182 |
|
|---|
| 183 |
(set-buffer "Keys") |
|---|
| 184 |
(insert "\ |
|---|
| 185 |
;; |
|---|
| 186 |
;; Key definitions for the EDT emulation within GNU Emacs |
|---|
| 187 |
;; |
|---|
| 188 |
|
|---|
| 189 |
(defconst *EDT-keys* |
|---|
| 190 |
'( |
|---|
| 191 |
") |
|---|
| 192 |
|
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 |
|
|---|
| 196 |
(switch-to-buffer "Directions") |
|---|
| 197 |
(if (and edt-window-system (not (eq edt-window-system 'tty))) |
|---|
| 198 |
(insert " |
|---|
| 199 |
EDT MAPPER |
|---|
| 200 |
|
|---|
| 201 |
You will be asked to press keys to create a custom mapping (under a |
|---|
| 202 |
Window Manager) of your keypad keys and function keys so that they can |
|---|
| 203 |
emulate the LK-201 keypad and function keys or the subset of keys found |
|---|
| 204 |
on a VT-100 series terminal keyboard. (The LK-201 keyboard is the |
|---|
| 205 |
standard keyboard attached to VT-200 series terminals, and above.) |
|---|
| 206 |
|
|---|
| 207 |
Sometimes, edt-mapper will ignore a key you press, and just continue to |
|---|
| 208 |
prompt for the same key. This can happen when your window manager sucks |
|---|
| 209 |
up the key and doesn't pass it on to Emacs, or it could be an Emacs bug. |
|---|
| 210 |
Either way, there's nothing that edt-mapper can do about it. You must |
|---|
| 211 |
press RETURN, to skip the current key and continue. Later, you and/or |
|---|
| 212 |
your local system guru can try to figure out why the key is being ignored. |
|---|
| 213 |
|
|---|
| 214 |
Start by pressing the RETURN key, and continue by pressing the keys |
|---|
| 215 |
specified in the mini-buffer. If you want to entirely omit a key, |
|---|
| 216 |
because your keyboard does not have a corresponding key, for example, |
|---|
| 217 |
just press RETURN at the prompt. |
|---|
| 218 |
|
|---|
| 219 |
") |
|---|
| 220 |
(insert " |
|---|
| 221 |
EDT MAPPER |
|---|
| 222 |
|
|---|
| 223 |
You will be asked to press keys to create a custom mapping of your |
|---|
| 224 |
keypad keys and function keys so that they can emulate the LK-201 |
|---|
| 225 |
keypad and function keys or the subset of keys found on a VT-100 |
|---|
| 226 |
series terminal keyboard. (The LK-201 keyboard is the standard |
|---|
| 227 |
keyboard attached to VT-200 series terminals, and above.) |
|---|
| 228 |
|
|---|
| 229 |
If you are using a real LK-201 keyboard, you should map the keys |
|---|
| 230 |
exactly as they are on the keyboard. |
|---|
| 231 |
|
|---|
| 232 |
Start by pressing the RETURN key, and continue by pressing the keys |
|---|
| 233 |
specified in the mini-buffer. If you want to entirely omit a key, |
|---|
| 234 |
because your keyboard does not have a corresponding key, for example, |
|---|
| 235 |
just press RETURN at the prompt. |
|---|
| 236 |
|
|---|
| 237 |
")) |
|---|
| 238 |
|
|---|
| 239 |
(delete-other-windows) |
|---|
| 240 |
|
|---|
| 241 |
|
|---|
| 242 |
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 |
|
|---|
| 246 |
|
|---|
| 247 |
(cond |
|---|
| 248 |
(edt-x-emacs-p |
|---|
| 249 |
(setq edt-return-seq (read-key-sequence "Hit carriage-return <CR> to continue ")) |
|---|
| 250 |
(setq edt-return (concat "[" (format "%s" (event-key (aref edt-return-seq 0))) "]"))) |
|---|
| 251 |
(t |
|---|
| 252 |
(if edt-window-system |
|---|
| 253 |
(progn |
|---|
| 254 |
(setq edt-save-function-key-map function-key-map) |
|---|
| 255 |
(setq function-key-map (make-sparse-keymap)))) |
|---|
| 256 |
(setq edt-return (read-key-sequence "Hit carriage-return <CR> to continue ")))) |
|---|
| 257 |
|
|---|
| 258 |
|
|---|
| 259 |
|
|---|
| 260 |
|
|---|
| 261 |
|
|---|
| 262 |
(global-unset-key [f1]) |
|---|
| 263 |
(global-unset-key [f2]) |
|---|
| 264 |
|
|---|
| 265 |
|
|---|
| 266 |
|
|---|
| 267 |
|
|---|
| 268 |
(set-buffer "Directions") |
|---|
| 269 |
(delete-region (point-min) (point-max)) |
|---|
| 270 |
(if (and edt-window-system (not (eq edt-window-system 'tty))) |
|---|
| 271 |
(insert " |
|---|
| 272 |
|
|---|
| 273 |
PRESS THE KEY SPECIFIED IN THE MINIBUFFER BELOW. |
|---|
| 274 |
|
|---|
| 275 |
Here's a picture of the standard LK-201 keypad for reference: |
|---|
| 276 |
|
|---|
| 277 |
_______________________ _______________________________ |
|---|
| 278 |
| HELP | DO | | F17 | F18 | F19 | F20 | |
|---|
| 279 |
| | | | | | | | |
|---|
| 280 |
|_______|_______________| |_______|_______|_______|_______| |
|---|
| 281 |
_______________________ _______________________________ |
|---|
| 282 |
| FIND |INSERT |REMOVE | | PF1 | PF2 | PF3 | PF4 | |
|---|
| 283 |
| | | | | | | | | |
|---|
| 284 |
|_______|_______|_______| |_______|_______|_______|_______| |
|---|
| 285 |
|SELECT |PREVIOU| NEXT | | KP7 | KP8 | KP9 | KP- | |
|---|
| 286 |
| | | | | | | | | |
|---|
| 287 |
|_______|_______|_______| |_______|_______|_______|_______| |
|---|
| 288 |
| UP | | KP4 | KP5 | KP6 | KP, | |
|---|
| 289 |
| | | | | | | |
|---|
| 290 |
_______|_______|_______ |_______|_______|_______|_______| |
|---|
| 291 |
| LEFT | DOWN | RIGHT | | KP1 | KP2 | KP3 | | |
|---|
| 292 |
| | | | | | | | | |
|---|
| 293 |
|_______|_______|_______| |_______|_______|_______| KPE | |
|---|
| 294 |
| KP0 | KPP | | |
|---|
| 295 |
| | | | |
|---|
| 296 |
|_______________|_______|_______| |
|---|
| 297 |
|
|---|
| 298 |
REMEMBER: JUST PRESS RETURN TO SKIP MAPPING A KEY. |
|---|
| 299 |
|
|---|
| 300 |
") |
|---|
| 301 |
(progn |
|---|
| 302 |
(insert " |
|---|
| 303 |
GENERATING A CUSTOM CONFIGURATION FILE FOR TERMINAL TYPE: ") |
|---|
| 304 |
(insert (format "%s." edt-term)) |
|---|
| 305 |
(insert " |
|---|
| 306 |
|
|---|
| 307 |
PRESS THE KEY SPECIFIED IN THE MINIBUFFER BELOW. |
|---|
| 308 |
|
|---|
| 309 |
_______________________ _______________________________ |
|---|
| 310 |
| HELP | DO | | F17 | F18 | F19 | F20 | |
|---|
| 311 |
|_______|_______________| |_______|_______|_______|_______| |
|---|
| 312 |
_______________________ _______________________________ |
|---|
| 313 |
| FIND |INSERT |REMOVE | | PF1 | PF2 | PF3 | PF4 | |
|---|
| 314 |
|_______|_______|_______| |_______|_______|_______|_______| |
|---|
| 315 |
|SELECT |PREVIOU| NEXT | | KP7 | KP8 | KP9 | KP- | |
|---|
| 316 |
|_______|_______|_______| |_______|_______|_______|_______| |
|---|
| 317 |
| UP | | KP4 | KP5 | KP6 | KP, | |
|---|
| 318 |
_______|_______|_______ |_______|_______|_______|_______| |
|---|
| 319 |
| LEFT | DOWN | RIGHT | | KP1 | KP2 | KP3 | | |
|---|
| 320 |
|_______|_______|_______| |_______|_______|_______| KPE | |
|---|
| 321 |
| KP0 | KPP | | |
|---|
| 322 |
|_______________|_______|_______| |
|---|
| 323 |
|
|---|
| 324 |
REMEMBER: JUST PRESS RETURN TO SKIP MAPPING A KEY."))) |
|---|
| 325 |
|
|---|
| 326 |
|
|---|
| 327 |
|
|---|
| 328 |
|
|---|
| 329 |
|
|---|
| 330 |
(defun edt-lucid-map-key (ident descrip) |
|---|
| 331 |
(interactive) |
|---|
| 332 |
(setq edt-key-seq (read-key-sequence (format "Press %s%s: " ident descrip))) |
|---|
| 333 |
(setq edt-key (concat "[" (format "%s" (event-key (aref edt-key-seq 0))) "]")) |
|---|
| 334 |
(cond ((not (equal edt-key edt-return)) |
|---|
| 335 |
(set-buffer "Keys") |
|---|
| 336 |
(insert (format " (\"%s\" . %s)\n" ident edt-key)) |
|---|
| 337 |
(set-buffer "Directions")) |
|---|
| 338 |
|
|---|
| 339 |
|
|---|
| 340 |
(t |
|---|
| 341 |
(set-buffer "Keys") |
|---|
| 342 |
(insert (format " (\"%s\" . \"\" )\n" ident)) |
|---|
| 343 |
(set-buffer "Directions"))) |
|---|
| 344 |
edt-key) |
|---|
| 345 |
|
|---|
| 346 |
(defun edt-gnu-map-key (ident descrip) |
|---|
| 347 |
(interactive) |
|---|
| 348 |
(setq edt-key (read-key-sequence (format "Press %s%s: " ident descrip))) |
|---|
| 349 |
(cond ((not (equal edt-key edt-return)) |
|---|
| 350 |
(set-buffer "Keys") |
|---|
| 351 |
(insert (if (vectorp edt-key) |
|---|
| 352 |
(format " (\"%s\" . %s)\n" ident edt-key) |
|---|
| 353 |
(format " (\"%s\" . \"%s\")\n" ident edt-key))) |
|---|
| 354 |
(set-buffer "Directions")) |
|---|
| 355 |
|
|---|
| 356 |
|
|---|
| 357 |
(t |
|---|
| 358 |
(set-buffer "Keys") |
|---|
| 359 |
(insert (format " (\"%s\" . \"\" )\n" ident)) |
|---|
| 360 |
(set-buffer "Directions"))) |
|---|
| 361 |
edt-key) |
|---|
| 362 |
|
|---|
| 363 |
(fset 'edt-map-key (if edt-x-emacs-p 'edt-lucid-map-key 'edt-gnu-map-key)) |
|---|
| 364 |
(set-buffer "Keys") |
|---|
| 365 |
(insert " |
|---|
| 366 |
;; |
|---|
| 367 |
;; Arrows |
|---|
| 368 |
;; |
|---|
| 369 |
") |
|---|
| 370 |
(set-buffer "Directions") |
|---|
| 371 |
|
|---|
| 372 |
(edt-map-key "UP" " - The Up Arrow Key") |
|---|
| 373 |
(edt-map-key "DOWN" " - The Down Arrow Key") |
|---|
| 374 |
(edt-map-key "LEFT" " - The Left Arrow Key") |
|---|
| 375 |
(edt-map-key "RIGHT" " - The Right Arrow Key") |
|---|
| 376 |
|
|---|
| 377 |
|
|---|
| 378 |
(set-buffer "Keys") |
|---|
| 379 |
(insert " |
|---|
| 380 |
;; |
|---|
| 381 |
;; PF keys |
|---|
| 382 |
;; |
|---|
| 383 |
") |
|---|
| 384 |
(set-buffer "Directions") |
|---|
| 385 |
|
|---|
| 386 |
(edt-map-key "PF1" " - The PF1 (GOLD) Key") |
|---|
| 387 |
(edt-map-key "PF2" " - The Keypad PF2 Key") |
|---|
| 388 |
(edt-map-key "PF3" " - The Keypad PF3 Key") |
|---|
| 389 |
(edt-map-key "PF4" " - The Keypad PF4 Key") |
|---|
| 390 |
|
|---|
| 391 |
(set-buffer "Keys") |
|---|
| 392 |
(insert " |
|---|
| 393 |
;; |
|---|
| 394 |
;; KP0-9 KP- KP, KPP and KPE |
|---|
| 395 |
;; |
|---|
| 396 |
") |
|---|
| 397 |
(set-buffer "Directions") |
|---|
| 398 |
|
|---|
| 399 |
(edt-map-key "KP0" " - The Keypad 0 Key") |
|---|
| 400 |
(edt-map-key "KP1" " - The Keypad 1 Key") |
|---|
| 401 |
(edt-map-key "KP2" " - The Keypad 2 Key") |
|---|
| 402 |
(edt-map-key "KP3" " - The Keypad 3 Key") |
|---|
| 403 |
(edt-map-key "KP4" " - The Keypad 4 Key") |
|---|
| 404 |
(edt-map-key "KP5" " - The Keypad 5 Key") |
|---|
| 405 |
(edt-map-key "KP6" " - The Keypad 6 Key") |
|---|
| 406 |
(edt-map-key "KP7" " - The Keypad 7 Key") |
|---|
| 407 |
(edt-map-key "KP8" " - The Keypad 8 Key") |
|---|
| 408 |
(edt-map-key "KP9" " - The Keypad 9 Key") |
|---|
| 409 |
(edt-map-key "KP-" " - The Keypad - Key") |
|---|
| 410 |
(edt-map-key "KP," " - The Keypad , Key") |
|---|
| 411 |
(edt-map-key "KPP" " - The Keypad . Key") |
|---|
| 412 |
(edt-map-key "KPE" " - The Keypad Enter Key") |
|---|
| 413 |
|
|---|
| 414 |
(setq edt-enter edt-key) |
|---|
| 415 |
(setq edt-enter-seq edt-key-seq) |
|---|
| 416 |
|
|---|
| 417 |
|
|---|
| 418 |
(set-buffer "Keys") |
|---|
| 419 |
(insert " |
|---|
| 420 |
;; |
|---|
| 421 |
;; Editing keypad (FIND, INSERT, REMOVE) |
|---|
| 422 |
;; (SELECT, PREVIOUS, NEXT) |
|---|
| 423 |
;; |
|---|
| 424 |
") |
|---|
| 425 |
(set-buffer "Directions") |
|---|
| 426 |
|
|---|
| 427 |
(edt-map-key "FIND" " - The Find key on the editing keypad") |
|---|
| 428 |
(edt-map-key "INSERT" " - The Insert key on the editing keypad") |
|---|
| 429 |
(edt-map-key "REMOVE" " - The Remove key on the editing keypad") |
|---|
| 430 |
(edt-map-key "SELECT" " - The Select key on the editing keypad") |
|---|
| 431 |
(edt-map-key "PREVIOUS" " - The Prev Scr key on the editing keypad") |
|---|
| 432 |
(edt-map-key "NEXT" " - The Next Scr key on the editing keypad") |
|---|
| 433 |
|
|---|
| 434 |
(set-buffer "Keys") |
|---|
| 435 |
(insert " |
|---|
| 436 |
;; |
|---|
| 437 |
;; F1-14 Help Do F17-F20 |
|---|
| 438 |
;; |
|---|
| 439 |
") |
|---|
| 440 |
(set-buffer "Directions") |
|---|
| 441 |
|
|---|
| 442 |
(edt-map-key "F1" " - F1 Function Key") |
|---|
| 443 |
(edt-map-key "F2" " - F2 Function Key") |
|---|
| 444 |
(edt-map-key "F3" " - F3 Function Key") |
|---|
| 445 |
(edt-map-key "F4" " - F4 Function Key") |
|---|
| 446 |
(edt-map-key "F5" " - F5 Function Key") |
|---|
| 447 |
(edt-map-key "F6" " - F6 Function Key") |
|---|
| 448 |
(edt-map-key "F7" " - F7 Function Key") |
|---|
| 449 |
(edt-map-key "F8" " - F8 Function Key") |
|---|
| 450 |
(edt-map-key "F9" " - F9 Function Key") |
|---|
| 451 |
(edt-map-key "F10" " - F10 Function Key") |
|---|
| 452 |
(edt-map-key "F11" " - F11 Function Key") |
|---|
| 453 |
(edt-map-key "F12" " - F12 Function Key") |
|---|
| 454 |
(edt-map-key "F13" " - F13 Function Key") |
|---|
| 455 |
(edt-map-key "F14" " - F14 Function Key") |
|---|
| 456 |
(edt-map-key "HELP" " - HELP Function Key") |
|---|
| 457 |
(edt-map-key "DO" " - DO Function Key") |
|---|
| 458 |
(edt-map-key "F17" " - F17 Function Key") |
|---|
| 459 |
(edt-map-key "F18" " - F18 Function Key") |
|---|
| 460 |
(edt-map-key "F19" " - F19 Function Key") |
|---|
| 461 |
(edt-map-key "F20" " - F20 Function Key") |
|---|
| 462 |
|
|---|
| 463 |
(set-buffer "Directions") |
|---|
| 464 |
(delete-region (point-min) (point-max)) |
|---|
| 465 |
(insert " |
|---|
| 466 |
ADDITIONAL FUNCTION KEYS |
|---|
| 467 |
|
|---|
| 468 |
Your keyboard may have additional function keys which do not correspond |
|---|
| 469 |
to any LK-201 keys. The EDT Emulation can be configured to recognize |
|---|
| 470 |
those keys, since you may wish to add your own key bindings to those keys. |
|---|
| 471 |
|
|---|
| 472 |
For example, suppose your keyboard has a keycap marked \"Line Del\" and |
|---|
| 473 |
you wish to add it to the list of keys which can be customized by the EDT |
|---|
| 474 |
Emulation. First, assign a unique single-word name to the key for use by |
|---|
| 475 |
the EDT Emulation, for example, \"linedel\". Then, at the \"EDT Key |
|---|
| 476 |
Name:\" prompt, enter \"linedel\", followed by a press of the RETURN key. |
|---|
| 477 |
Finally, when prompted, press the \"Line Del\" key. You now will be able |
|---|
| 478 |
to bind functions to \"linedel\" and \"Gold-linedel\" in edt-user.el in |
|---|
| 479 |
just the same way you can customize bindings of the LK-201 function and |
|---|
| 480 |
keypad keys. |
|---|
| 481 |
|
|---|
| 482 |
When you are done, just press RETURN at the \"EDT Key Name:\" prompt. |
|---|
| 483 |
") |
|---|
| 484 |
(switch-to-buffer "Directions") |
|---|
| 485 |
|
|---|
| 486 |
|
|---|
| 487 |
|
|---|
| 488 |
(set-buffer "Keys") |
|---|
| 489 |
(insert "\ |
|---|
| 490 |
;; |
|---|
| 491 |
;; Extra Keys |
|---|
| 492 |
;; |
|---|
| 493 |
") |
|---|
| 494 |
|
|---|
| 495 |
|
|---|
| 496 |
|
|---|
| 497 |
(if (and edt-window-system (not edt-x-emacs-p)) |
|---|
| 498 |
(setq function-key-map edt-save-function-key-map)) |
|---|
| 499 |
(setq EDT-key-name "") |
|---|
| 500 |
(while (not |
|---|
| 501 |
(string-equal (setq EDT-key-name (read-string "EDT Key Name: ")) "")) |
|---|
| 502 |
(edt-map-key EDT-key-name "")) |
|---|
| 503 |
|
|---|
| 504 |
|
|---|
| 505 |
|
|---|
| 506 |
|
|---|
| 507 |
(set-buffer "Keys") |
|---|
| 508 |
(insert "\ |
|---|
| 509 |
) |
|---|
| 510 |
) |
|---|
| 511 |
") |
|---|
| 512 |
|
|---|
| 513 |
|
|---|
| 514 |
|
|---|
| 515 |
|
|---|
| 516 |
|
|---|
| 517 |
|
|---|
| 518 |
|
|---|
| 519 |
(let ((file (concat |
|---|
| 520 |
"~/.edt-" edt-emacs-variant |
|---|
| 521 |
(if edt-term (concat "-" edt-term)) |
|---|
| 522 |
(if edt-xserver (concat "-" edt-xserver)) |
|---|
| 523 |
(if edt-window-system (concat "-" (upcase (symbol-name edt-window-system)))) |
|---|
| 524 |
"-keys"))) |
|---|
| 525 |
(set-visited-file-name |
|---|
| 526 |
(read-file-name (format "Save key mapping to file (default %s): " file) nil file))) |
|---|
| 527 |
(save-buffer) |
|---|
| 528 |
|
|---|
| 529 |
(message "That's it! Press any key to exit") |
|---|
| 530 |
(sit-for 600) |
|---|
| 531 |
(kill-emacs t) |
|---|
| 532 |
|
|---|
| 533 |
|
|---|
| 534 |
|
|---|
| 535 |
|
|---|