7.0;kd (key_definition) *DM*, revision 7.0, 83/08/15
KD (KEY_DEFINITION) *DM* -- Set or display key definition.
usage: kd key_name [[definition] ke]
FORMAT
KD key_name [[definition] KE]
The KD command defines a keyboard key as a sequence of DM commands.
It also can display the definition of a key.
ARGUMENTS
key_name
(required) Specify the name of the key to be defined or displayed.
Key names are available from HELP DM KEYS. Enclose normal
alphanumeric and punctuation keys in quotation marks.
definition
(optional) Specify sequence of DM commands that represent desired
key function; separate commands with NEWLINEs or semicolons.
Definition can be any number of commands, but cannot exceed
256 characters. Definitions may contain other pre-defined
keys (i.e., key definitions may be embedded in one another).
The input request character, '&', which is frequently used
in key definitions, must be preceded by an escape character
(@) when the KD command appears in a script.
If 'definition' is not specified and KE is present (i.e.,
definition is null), then the current key definition is
deleted and the key reverts to its normal graphic value,
if any. If KE is also absent, then the definition of the
named key is displayed in the DM message window.
Default if omitted: see above
KE
(optional) Signal the end of the KD command. This argument is required
if 'definition' is present, or if you wish to delete a
definition by specifying a null definition.
Default if omitted: display key_name definition
EXAMPLES
1. Command: KD L3 Display definition of key L3.
2. Command: KD F6 AU;TR KE Define F6 key to move the cursor to end of
previous line in window.
3. Command: KD ^C KE Delete current definition of CTRL/C.
You can embed key definitions in key definitions, and thereby define keys
that define other keys. The embedded key definition follows the same rules
as any other key definition. The KE that ends the embedded definition must
be separated from the next command by an "escaped" semicolon; that is, a
semicolon preceded by the @ character.
For example:
Command: KD F3 KD ^X ES 'April is the cruelest month' KE@; PV KE
changes the definition of the F3 key, which normally just invokes the DM
command PV, so that it also changes the definition of CTRL/X to print out
the string shown. If the ';' were not preceded by an escape character,
the definition would not be accepted.
Note that key definitions within key definitions are scanned THREE times:
1) when the outer key definition is made, 2) when the outer key definition
is executed and the inner key definition is made, and 3) when the inner key
definition is executed. Because of this, you must exercise great care when
escaping (with "@") certain special characters such as "@" itself.
RELATED TOPICS
More information is available. Type:
- HELP DM KEYS
for a list of standard key definitions