Mercurial > emacs
annotate lisp/emulation/edt-mapper.el @ 71414:6328b7a0d755
(Version, mh-version): Update for release 8.0.1.
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Wed, 21 Jun 2006 05:12:13 +0000 |
parents | 067115a6e738 |
children | 84aef5a30c72 c5406394f567 |
rev | line source |
---|---|
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
35123
diff
changeset
|
1 ;;; edt-mapper.el --- create an EDT LK-201 map file for X-Windows Emacs |
10690 | 2 |
64701
34bd8e434dd7
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
3 ;; Copyright (C) 1994, 1995, 2000, 2001, 2002, 2003, 2004, |
68648
067115a6e738
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64701
diff
changeset
|
4 ;; 2005, 2006 Free Software Foundation, Inc. |
10690 | 5 |
18942 | 6 ;; Author: Kevin Gallagher <kevingal@onramp.net> |
7 ;; Maintainer: Kevin Gallagher <kevingal@onramp.net> | |
10690 | 8 ;; Keywords: emulations |
9 | |
10691 | 10 ;; This file is part of GNU Emacs. |
10690 | 11 |
12 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
13 ;; it under the terms of the GNU General Public License as published by | |
14 ;; the Free Software Foundation; either version 2, or (at your option) | |
15 ;; any later version. | |
16 | |
17 ;; GNU Emacs is distributed in the hope that it will be useful, | |
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 ;; GNU General Public License for more details. | |
21 | |
22 ;; You should have received a copy of the GNU General Public License | |
14169 | 23 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64085 | 24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
25 ;; Boston, MA 02110-1301, USA. | |
10690 | 26 |
27 ;;; Commentary: | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
28 ;; |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
29 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
30 ;; [Part of the GNU Emacs EDT Emulation.] |
10690 | 31 |
32 ;; This emacs lisp program can be used to create an emacs lisp file | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
33 ;; that defines the mapping of the user's keyboard to the LK-201 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
34 ;; keyboard function keys and keypad keys (around which EDT has been |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
35 ;; designed). Please read the "Usage" AND "Known Problems" sections |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
36 ;; below before attempting to run this program. (The design of this |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
37 ;; file, edt-mapper.el, was heavily influenced by tpu-mapper.el.) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
38 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
39 ;; Version 4.0 contains the following enhancements: |
10690 | 40 |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
41 ;; 1. If you access a workstation using an X Server, note that the |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
42 ;; initialization file generated by edt-mapper.el will now |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
43 ;; contain the name of the X Server vendor. This is a |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
44 ;; convenience for those who have access to their Unix account |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
45 ;; from more than one type of X Server. Since different X |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
46 ;; Servers typically require different EDT emulation |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
47 ;; initialization files, edt-mapper.el will now generate these |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
48 ;; different initialization files and save them with different |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
49 ;; names. |
10690 | 50 |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
51 ;; 2. Also, edt-mapper.el is now capable of binding an ASCII key |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
52 ;; sequence, providing the ASCII key sequence prefix is already |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
53 ;; known by Emacs to be a prefix. As a result, some |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
54 ;; terminal/keyboard/window system configurations, which don't |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
55 ;; have a complete set of sensible function key map bindings, can |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
56 ;; still be configured for EDT Emulation. |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
57 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
58 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
59 ;; Usage: |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
60 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
61 ;; Simply load this file into emacs (version 19 or higher) |
10690 | 62 ;; using the following command. |
63 | |
64 ;; emacs -q -l edt-mapper.el | |
65 | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
66 ;; The "-q" option prevents loading of your .emacs file (commands |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
67 ;; therein might confuse this program). |
10690 | 68 |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
69 ;; An instruction screen showing the typical LK-201 terminal |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
70 ;; functions keys will be displayed, and you will be prompted to |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
71 ;; press the keys on your keyboard which you want to emulate the |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
72 ;; corresponding LK-201 keys. |
10690 | 73 |
74 ;; Finally, you will be prompted for the name of the file to store | |
75 ;; the key definitions. If you chose the default, it will be found | |
76 ;; and loaded automatically when the EDT emulation is started. If | |
77 ;; you specify a different file name, you will need to set the | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
78 ;; variable "edt-keys-file" before starting the EDT emulation. |
10690 | 79 ;; Here's how you might go about doing that in your .emacs file. |
80 | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
81 ;; (setq edt-keys-file (expand-file-name "~/.my-emacs-keys")) |
10690 | 82 |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
83 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
84 ;; Known Problems: |
10690 | 85 |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
86 ;; Sometimes, edt-mapper will ignore a key you press, and just |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
87 ;; continue to prompt for the same key. This can happen when your |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
88 ;; window manager sucks up the key and doesn't pass it on to emacs, |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
89 ;; or it could be an emacs bug. Either way, there's nothing that |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
90 ;; edt-mapper can do about it. You must press RETURN, to skip the |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
91 ;; current key and continue. Later, you and/or your local Emacs guru |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
92 ;; can try to figure out why the key is being ignored. |
10690 | 93 |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
94 ;;; History: |
47940
c6a3d10a0675
(top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
95 ;; |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
96 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
97 ;; Version 4.0 2000 Added 2 New Features |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
98 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
99 ;;; Code: |
10690 | 100 |
101 ;;; | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
102 ;;; Make sure we're running Emacs version 19, or higher. |
10690 | 103 ;;; |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
104 |
10690 | 105 (cond |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
106 ((string-lessp emacs-version "19") |
10690 | 107 (insert " |
108 | |
109 Whoa! This isn't going to work... | |
110 | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
111 You must run edt-mapper.el under Emacs version 19 or higher. |
10690 | 112 |
113 Press any key to exit. ") | |
114 (sit-for 600) | |
115 (kill-emacs t))) | |
116 | |
117 ;;; | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
118 ;;; Decide Emacs Variant, GNU Emacs or XEmacs (aka Lucid Emacs). |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
119 ;;; Determine Window System, and X Server Vendor (if appropriate). |
10690 | 120 ;;; |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
121 (defconst edt-x-emacs-p (string-match "XEmacs" emacs-version) |
42206 | 122 "Non-nil if we are running XEmacs version 19, or higher.") |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
123 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
124 (defconst edt-emacs-variant (if edt-x-emacs-p "xemacs" "gnu") |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
125 "Indicates Emacs variant: GNU Emacs or XEmacs \(aka Lucid Emacs\).") |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
126 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
127 (defconst edt-window-system (if edt-x-emacs-p (console-type) window-system) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
128 "Indicates window system \(in GNU Emacs\) or console type \(in XEmacs\).") |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
129 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
130 (defconst edt-xserver (if (eq edt-window-system 'x) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
131 (if edt-x-emacs-p |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
132 (replace-in-string (x-server-vendor) "[ _]" "-") |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
133 (subst-char-in-string ? ?- (x-server-vendor))) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
134 nil) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
135 "Indicates X server vendor name, if applicable.") |
10690 | 136 |
137 | |
138 ;;; | |
139 ;;; Key variables | |
140 ;;; | |
141 (defvar edt-key nil) | |
142 (defvar edt-enter nil) | |
143 (defvar edt-return nil) | |
144 (defvar edt-key-seq nil) | |
145 (defvar edt-enter-seq nil) | |
146 (defvar edt-return-seq nil) | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
147 (defvar edt-term nil) |
10690 | 148 |
63915
96d313e6f018
(edt-save-function-key-map, EDT-key-name): `defvar' to silence the
Juanma Barranquero <lekktu@gmail.com>
parents:
52401
diff
changeset
|
149 ;; To silence the byte-compiler |
96d313e6f018
(edt-save-function-key-map, EDT-key-name): `defvar' to silence the
Juanma Barranquero <lekktu@gmail.com>
parents:
52401
diff
changeset
|
150 (eval-when-compile |
96d313e6f018
(edt-save-function-key-map, EDT-key-name): `defvar' to silence the
Juanma Barranquero <lekktu@gmail.com>
parents:
52401
diff
changeset
|
151 (defvar EDT-key-name) |
96d313e6f018
(edt-save-function-key-map, EDT-key-name): `defvar' to silence the
Juanma Barranquero <lekktu@gmail.com>
parents:
52401
diff
changeset
|
152 (defvar edt-save-function-key-map)) |
96d313e6f018
(edt-save-function-key-map, EDT-key-name): `defvar' to silence the
Juanma Barranquero <lekktu@gmail.com>
parents:
52401
diff
changeset
|
153 |
47940
c6a3d10a0675
(top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
154 ;;; |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
155 ;;; Determine Terminal Type (if appropriate). |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
156 ;;; |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
157 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
158 (if (and edt-window-system (not (eq edt-window-system 'tty))) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
159 (setq edt-term nil) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
160 (setq edt-term (getenv "TERM"))) |
10690 | 161 |
162 ;;; | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
163 ;;; Make sure the window is big enough to display the instructions, |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
164 ;;; except where window cannot be re-sized. |
47940
c6a3d10a0675
(top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
165 ;;; |
10690 | 166 |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
167 (if (and edt-window-system (not (eq edt-window-system 'tty))) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
168 (set-frame-size (selected-frame) 80 36)) |
10690 | 169 |
170 ;;; | |
171 ;;; Create buffers - Directions and Keys | |
172 ;;; | |
173 (if (not (get-buffer "Directions")) (generate-new-buffer "Directions")) | |
174 (if (not (get-buffer "Keys")) (generate-new-buffer "Keys")) | |
175 | |
176 ;;; | |
177 ;;; Put header in the Keys buffer | |
178 ;;; | |
179 (set-buffer "Keys") | |
180 (insert "\ | |
181 ;; | |
182 ;; Key definitions for the EDT emulation within GNU Emacs | |
183 ;; | |
184 | |
185 (defconst *EDT-keys* | |
186 '( | |
187 ") | |
188 | |
189 ;;; | |
190 ;;; Display directions | |
191 ;;; | |
192 (switch-to-buffer "Directions") | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
193 (if (and edt-window-system (not (eq edt-window-system 'tty))) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
194 (insert " |
10690 | 195 EDT MAPPER |
196 | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
197 You will be asked to press keys to create a custom mapping (under a |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
198 Window Manager) of your keypad keys and function keys so that they can |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
199 emulate the LK-201 keypad and function keys or the subset of keys found |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
200 on a VT-100 series terminal keyboard. (The LK-201 keyboard is the |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
201 standard keyboard attached to VT-200 series terminals, and above.) |
10690 | 202 |
203 Sometimes, edt-mapper will ignore a key you press, and just continue to | |
204 prompt for the same key. This can happen when your window manager sucks | |
205 up the key and doesn't pass it on to emacs, or it could be an emacs bug. | |
206 Either way, there's nothing that edt-mapper can do about it. You must | |
207 press RETURN, to skip the current key and continue. Later, you and/or | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
208 your local system guru can try to figure out why the key is being ignored. |
10690 | 209 |
210 Start by pressing the RETURN key, and continue by pressing the keys | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
211 specified in the mini-buffer. If you want to entirely omit a key, |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
212 because your keyboard does not have a corresponding key, for example, |
10690 | 213 just press RETURN at the prompt. |
214 | |
215 ") | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
216 (insert " |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
217 EDT MAPPER |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
218 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
219 You will be asked to press keys to create a custom mapping of your |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
220 keypad keys and function keys so that they can emulate the LK-201 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
221 keypad and function keys or the subset of keys found on a VT-100 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
222 series terminal keyboard. (The LK-201 keyboard is the standard |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
223 keyboard attached to VT-200 series terminals, and above.) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
224 |
47940
c6a3d10a0675
(top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
225 If you are using a real LK-201 keyboard, you should map the keys |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
226 exactly as they are on the keyboard. |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
227 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
228 Start by pressing the RETURN key, and continue by pressing the keys |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
229 specified in the mini-buffer. If you want to entirely omit a key, |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
230 because your keyboard does not have a corresponding key, for example, |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
231 just press RETURN at the prompt. |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
232 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
233 ")) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
234 |
10690 | 235 (delete-other-windows) |
236 | |
237 ;;; | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
238 ;;; Save <CR> for future reference. |
10690 | 239 ;;; |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
240 ;;; For GNU Emacs, running in a Window System, first hide bindings in |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
241 ;;; function-key-map. |
47940
c6a3d10a0675
(top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
242 ;;; |
10690 | 243 (cond |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
244 (edt-x-emacs-p |
10690 | 245 (setq edt-return-seq (read-key-sequence "Hit carriage-return <CR> to continue ")) |
246 (setq edt-return (concat "[" (format "%s" (event-key (aref edt-return-seq 0))) "]"))) | |
247 (t | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
248 (if edt-window-system |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
249 (progn |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
250 (setq edt-save-function-key-map function-key-map) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
251 (setq function-key-map (make-sparse-keymap)))) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
252 (setq edt-return (read-key-sequence "Hit carriage-return <CR> to continue ")))) |
10690 | 253 |
254 ;;; | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
255 ;;; Remove prefix-key bindings to F1 and F2 in global-map so they can be |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
256 ;;; bound in the EDT Emulation mode. |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
257 ;;; |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
258 (global-unset-key [f1]) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
259 (global-unset-key [f2]) |
47940
c6a3d10a0675
(top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
260 |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
261 ;;; |
10690 | 262 ;;; Display Keypad Diagram and Begin Prompting for Keys |
263 ;;; | |
264 (set-buffer "Directions") | |
265 (delete-region (point-min) (point-max)) | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
266 (if (and edt-window-system (not (eq edt-window-system 'tty))) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
267 (insert " |
10690 | 268 |
269 PRESS THE KEY SPECIFIED IN THE MINIBUFFER BELOW. | |
270 | |
271 Here's a picture of the standard LK-201 keypad for reference: | |
272 | |
273 _______________________ _______________________________ | |
274 | HELP | DO | | F17 | F18 | F19 | F20 | | |
275 | | | | | | | | | |
276 |_______|_______________| |_______|_______|_______|_______| | |
277 _______________________ _______________________________ | |
278 | FIND |INSERT |REMOVE | | PF1 | PF2 | PF3 | PF4 | | |
279 | | | | | | | | | | |
280 |_______|_______|_______| |_______|_______|_______|_______| | |
281 |SELECT |PREVIOU| NEXT | | KP7 | KP8 | KP9 | KP- | | |
282 | | | | | | | | | | |
283 |_______|_______|_______| |_______|_______|_______|_______| | |
284 | UP | | KP4 | KP5 | KP6 | KP, | | |
285 | | | | | | | | |
286 _______|_______|_______ |_______|_______|_______|_______| | |
287 | LEFT | DOWN | RIGHT | | KP1 | KP2 | KP3 | | | |
288 | | | | | | | | | | |
289 |_______|_______|_______| |_______|_______|_______| KPE | | |
290 | KP0 | KPP | | | |
291 | | | | | |
292 |_______________|_______|_______| | |
293 | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
294 REMEMBER: JUST PRESS RETURN TO SKIP MAPPING A KEY. |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
295 |
10690 | 296 ") |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
297 (progn |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
298 (insert " |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
299 GENERATING A CUSTOM CONFIGURATION FILE FOR TERMINAL TYPE: ") |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
300 (insert (format "%s." edt-term)) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
301 (insert " |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
302 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
303 PRESS THE KEY SPECIFIED IN THE MINIBUFFER BELOW. |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
304 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
305 _______________________ _______________________________ |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
306 | HELP | DO | | F17 | F18 | F19 | F20 | |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
307 |_______|_______________| |_______|_______|_______|_______| |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
308 _______________________ _______________________________ |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
309 | FIND |INSERT |REMOVE | | PF1 | PF2 | PF3 | PF4 | |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
310 |_______|_______|_______| |_______|_______|_______|_______| |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
311 |SELECT |PREVIOU| NEXT | | KP7 | KP8 | KP9 | KP- | |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
312 |_______|_______|_______| |_______|_______|_______|_______| |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
313 | UP | | KP4 | KP5 | KP6 | KP, | |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
314 _______|_______|_______ |_______|_______|_______|_______| |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
315 | LEFT | DOWN | RIGHT | | KP1 | KP2 | KP3 | | |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
316 |_______|_______|_______| |_______|_______|_______| KPE | |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
317 | KP0 | KPP | | |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
318 |_______________|_______|_______| |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
319 |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
320 REMEMBER: JUST PRESS RETURN TO SKIP MAPPING A KEY."))) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
321 |
10690 | 322 |
323 ;;; | |
324 ;;; Key mapping functions | |
325 ;;; | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
326 (defun edt-lucid-map-key (ident descrip) |
10690 | 327 (interactive) |
328 (setq edt-key-seq (read-key-sequence (format "Press %s%s: " ident descrip))) | |
329 (setq edt-key (concat "[" (format "%s" (event-key (aref edt-key-seq 0))) "]")) | |
330 (cond ((not (equal edt-key edt-return)) | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
331 (set-buffer "Keys") |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
332 (insert (format " (\"%s\" . %s)\n" ident edt-key)) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
333 (set-buffer "Directions")) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
334 ;; bogosity to get next prompt to come up, if the user hits <CR>! |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
335 ;; check periodically to see if this is still needed... |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
336 (t |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
337 (set-buffer "Keys") |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
338 (insert (format " (\"%s\" . \"\" )\n" ident)) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
339 (set-buffer "Directions"))) |
10690 | 340 edt-key) |
341 | |
342 (defun edt-gnu-map-key (ident descrip) | |
343 (interactive) | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
344 (setq edt-key (read-key-sequence (format "Press %s%s: " ident descrip))) |
10690 | 345 (cond ((not (equal edt-key edt-return)) |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
346 (set-buffer "Keys") |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
347 (insert (if (vectorp edt-key) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
348 (format " (\"%s\" . %s)\n" ident edt-key) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
349 (format " (\"%s\" . \"%s\")\n" ident edt-key))) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
350 (set-buffer "Directions")) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
351 ;; bogosity to get next prompt to come up, if the user hits <CR>! |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
352 ;; check periodically to see if this is still needed... |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
353 (t |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
354 (set-buffer "Keys") |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
355 (insert (format " (\"%s\" . \"\" )\n" ident)) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
356 (set-buffer "Directions"))) |
10690 | 357 edt-key) |
358 | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
359 (fset 'edt-map-key (if edt-x-emacs-p 'edt-lucid-map-key 'edt-gnu-map-key)) |
10690 | 360 (set-buffer "Keys") |
361 (insert " | |
362 ;; | |
363 ;; Arrows | |
364 ;; | |
365 ") | |
366 (set-buffer "Directions") | |
367 | |
368 (edt-map-key "UP" " - The Up Arrow Key") | |
369 (edt-map-key "DOWN" " - The Down Arrow Key") | |
370 (edt-map-key "LEFT" " - The Left Arrow Key") | |
371 (edt-map-key "RIGHT" " - The Right Arrow Key") | |
372 | |
373 | |
374 (set-buffer "Keys") | |
375 (insert " | |
376 ;; | |
377 ;; PF keys | |
378 ;; | |
379 ") | |
380 (set-buffer "Directions") | |
381 | |
382 (edt-map-key "PF1" " - The PF1 (GOLD) Key") | |
383 (edt-map-key "PF2" " - The Keypad PF2 Key") | |
384 (edt-map-key "PF3" " - The Keypad PF3 Key") | |
385 (edt-map-key "PF4" " - The Keypad PF4 Key") | |
386 | |
387 (set-buffer "Keys") | |
388 (insert " | |
389 ;; | |
390 ;; KP0-9 KP- KP, KPP and KPE | |
391 ;; | |
392 ") | |
393 (set-buffer "Directions") | |
394 | |
395 (edt-map-key "KP0" " - The Keypad 0 Key") | |
396 (edt-map-key "KP1" " - The Keypad 1 Key") | |
397 (edt-map-key "KP2" " - The Keypad 2 Key") | |
398 (edt-map-key "KP3" " - The Keypad 3 Key") | |
399 (edt-map-key "KP4" " - The Keypad 4 Key") | |
400 (edt-map-key "KP5" " - The Keypad 5 Key") | |
401 (edt-map-key "KP6" " - The Keypad 6 Key") | |
402 (edt-map-key "KP7" " - The Keypad 7 Key") | |
403 (edt-map-key "KP8" " - The Keypad 8 Key") | |
404 (edt-map-key "KP9" " - The Keypad 9 Key") | |
405 (edt-map-key "KP-" " - The Keypad - Key") | |
406 (edt-map-key "KP," " - The Keypad , Key") | |
407 (edt-map-key "KPP" " - The Keypad . Key") | |
408 (edt-map-key "KPE" " - The Keypad Enter Key") | |
409 ;; Save the enter key | |
410 (setq edt-enter edt-key) | |
411 (setq edt-enter-seq edt-key-seq) | |
412 | |
413 | |
414 (set-buffer "Keys") | |
415 (insert " | |
416 ;; | |
417 ;; Editing keypad (FIND, INSERT, REMOVE) | |
418 ;; (SELECT, PREVIOUS, NEXT) | |
419 ;; | |
420 ") | |
421 (set-buffer "Directions") | |
422 | |
423 (edt-map-key "FIND" " - The Find key on the editing keypad") | |
424 (edt-map-key "INSERT" " - The Insert key on the editing keypad") | |
425 (edt-map-key "REMOVE" " - The Remove key on the editing keypad") | |
426 (edt-map-key "SELECT" " - The Select key on the editing keypad") | |
427 (edt-map-key "PREVIOUS" " - The Prev Scr key on the editing keypad") | |
428 (edt-map-key "NEXT" " - The Next Scr key on the editing keypad") | |
429 | |
430 (set-buffer "Keys") | |
431 (insert " | |
432 ;; | |
433 ;; F1-14 Help Do F17-F20 | |
434 ;; | |
435 ") | |
436 (set-buffer "Directions") | |
437 | |
438 (edt-map-key "F1" " - F1 Function Key") | |
439 (edt-map-key "F2" " - F2 Function Key") | |
440 (edt-map-key "F3" " - F3 Function Key") | |
441 (edt-map-key "F4" " - F4 Function Key") | |
442 (edt-map-key "F5" " - F5 Function Key") | |
443 (edt-map-key "F6" " - F6 Function Key") | |
444 (edt-map-key "F7" " - F7 Function Key") | |
445 (edt-map-key "F8" " - F8 Function Key") | |
446 (edt-map-key "F9" " - F9 Function Key") | |
447 (edt-map-key "F10" " - F10 Function Key") | |
448 (edt-map-key "F11" " - F11 Function Key") | |
449 (edt-map-key "F12" " - F12 Function Key") | |
450 (edt-map-key "F13" " - F13 Function Key") | |
451 (edt-map-key "F14" " - F14 Function Key") | |
452 (edt-map-key "HELP" " - HELP Function Key") | |
453 (edt-map-key "DO" " - DO Function Key") | |
454 (edt-map-key "F17" " - F17 Function Key") | |
455 (edt-map-key "F18" " - F18 Function Key") | |
456 (edt-map-key "F19" " - F19 Function Key") | |
457 (edt-map-key "F20" " - F20 Function Key") | |
458 | |
459 (set-buffer "Directions") | |
460 (delete-region (point-min) (point-max)) | |
461 (insert " | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
462 ADDITIONAL FUNCTION KEYS |
10690 | 463 |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
464 Your keyboard may have additional function keys which do not correspond |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
465 to any LK-201 keys. The EDT Emulation can be configured to recognize |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
466 those keys, since you may wish to add your own key bindings to those keys. |
47940
c6a3d10a0675
(top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
467 |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
468 For example, suppose your keyboard has a keycap marked \"Line Del\" and |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
469 you wish to add it to the list of keys which can be customized by the EDT |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
470 Emulation. First, assign a unique single-word name to the key for use by |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
471 the EDT Emulation, for example, \"linedel\". Then, at the \"EDT Key |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
472 Name:\" prompt, enter \"linedel\", followed by a press of the RETURN key. |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
473 Finally, when prompted, press the \"Line Del\" key. You now will be able |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
474 to bind functions to \"linedel\" and \"Gold-linedel\" in edt-user.el in |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
475 just the same way you can customize bindings of the LK-201 function and |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
476 keypad keys. |
10690 | 477 |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
478 When you are done, just press RETURN at the \"EDT Key Name:\" prompt. |
10690 | 479 ") |
480 (switch-to-buffer "Directions") | |
481 ;;; | |
482 ;;; Add support for extras keys | |
483 ;;; | |
484 (set-buffer "Keys") | |
485 (insert "\ | |
486 ;; | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
487 ;; Extra Keys |
10690 | 488 ;; |
489 ") | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
490 ;;; |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
491 ;;; Restore function-key-map. |
47940
c6a3d10a0675
(top-level): Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents:
42206
diff
changeset
|
492 ;;; |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
493 (if (and edt-window-system (not edt-x-emacs-p)) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
494 (setq function-key-map edt-save-function-key-map)) |
10690 | 495 (setq EDT-key-name "") |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
496 (while (not |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
497 (string-equal (setq EDT-key-name (read-string "EDT Key Name: ")) "")) |
10690 | 498 (edt-map-key EDT-key-name "")) |
499 | |
500 ; | |
501 ; No more keys to add, so wrap up. | |
502 ; | |
503 (set-buffer "Keys") | |
504 (insert "\ | |
505 ) | |
506 ) | |
507 ") | |
508 | |
509 ;;; | |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
510 ;;; Save the key mapping program |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
511 ;;; |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
512 ;;; |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
513 ;;; Save the key mapping file |
10690 | 514 ;;; |
35123
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
515 (let ((file (concat |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
516 "~/.edt-" edt-emacs-variant |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
517 (if edt-term (concat "-" edt-term)) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
518 (if edt-xserver (concat "-" edt-xserver)) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
519 (if edt-window-system (concat "-" (upcase (symbol-name edt-window-system)))) |
767b546e1676
Update to version 4.0. Provide support
Gerd Moellmann <gerd@gnu.org>
parents:
18942
diff
changeset
|
520 "-keys"))) |
10690 | 521 (set-visited-file-name |
522 (read-file-name (format "Save key mapping to file (default %s): " file) nil file))) | |
523 (save-buffer) | |
524 | |
525 (message "That's it! Press any key to exit") | |
526 (sit-for 600) | |
527 (kill-emacs t) | |
528 | |
52401 | 529 ;;; arch-tag: 9eea59c8-b8b7-4d66-b858-c8920624c518 |
10690 | 530 ;;; edt-mapper.el ends here |