Format
DEFINE KEY [ qualifier ] ... key-name key-equivalence
1 – Parameters
1.1 – key-name
Specifies the key you are defining.
1.2 – key-equivalence
Specifies the character string you want processed when you press
the key. Enclose the string in quotation marks to preserve spaces
and lowercase characters.
2 – Qualifiers
2.1 /ECHO
Format options:
/ECHO (default)
/NOECHO
Specifies whether CDO displays the equivalence string on your
terminal screen after you press a key. The default is ECHO, which
displays the equivalence string.
You cannot use the /NOECHO qualifier with the /NOTERMINATE
qualifier.
2.2 /IF_STATE
Format options:
/IF_STATE=state-name
/NOIF_STATE (default)
Specifies the state that must be in effect for a key definition
to work. If you omit the /IF_STATE qualifier or use the /NOIF_
STATE qualifier, CDO uses the current state. The state name is
an alphanumeric string. The /SET_STATE qualifier or the SET KEY
command establishes the state.
2.3 /LOCK_STATE
Format options:
/LOCK_STATE
/NOLOCK_STATE (default)
Specifies whether the state set by the /SET_STATE qualifier
remains in effect until a user explicitly changes it. By default,
the /SET_STATE qualifier is in effect only for the next definable
key you press or the next read-terminating character that you
type.
If you specify the /LOCK_STATE qualifier, you must also specify
the /SET_STATE qualifier.
2.4 /PROTECTED
Format options:
/PROTECTED
/NOPROTECTED (default)
Specifies whether CDO protects a key against later redefinition.
The default is no protection against redefinition.
2.5 /SET_STATE
Format options:
/SET_STATE=state-name
/NOSET_STATE (default)
Specifies a new state for CDO to set when you press a key; by
default, CDO resets the current locked state. If you have not
included this qualifier in a key definition, you can use the SET
KEY command to change the current state. The state name can be
any alphanumeric string.
2.6 /TERMINATE
Format options:
/TERMINATE
/NOTERMINATE (default)
Specifies whether CDO immediately processes the key definition
when you press the key (equivalent to typing the string and
pressing the Return key).
The default is NOTERMINATE, which allows you to press other keys
before CDO processes the definition. The /NOTERMINATE qualifier
allows you to create key definitions that insert text into
command lines, after prompts, or into other text that you are
typing.
You cannot use the /NOTERMINATE qualifier with the /NOECHO
qualifier.
3 – Description
The DEFINE KEY command assigns definitions to the peripheral keys
on certain terminals. These definitions can direct CDO to perform
one of the following actions:
o Execute a CDO command
o Append a qualifier to a CDO command
o Append a text string to a CDO or system-level command
When you define a key to insert a text string, use the
/NOTERMINATE qualifier so that you can continue typing more data
after CDO inserts the string.
You should take advantage of the echo feature in most instances.
With /ECHO set, CDO displays the key definition on the screen
each time you press the key.
You can use the /SET_STATE qualifier to increase the number of
key definitions available on your terminal keyboard. You can
assign the same key any number of definitions, as long as you
associate each definition with a different state. State names can
contain alphanumeric characters, dollar signs, and underscores.
See the SET KEY command for information on changing keypad
states.
Redefineable Key Names and Terminal Designations lists the keys
you can define on the keyboards of different terminals.
Table 1-3 Redefineable Key Names and Terminal Designations
Key Name VT100-series VT200- and VT300-series
PF1 PF1 PF1
PF2 PF2 PF2
PF3 PF3 PF3
PF4 PF4 PF4
KP0, KP1, ..., 0, 1, ..., 9 0, 1, ..., 9
KP9
PERIOD . .
COMMA , ,
MINUS - -
ENTER ENTER ENTER
LEFT < - < -
RIGHT - > - >
E1 - FIND
E2 - INSERT HERE
E3 - REMOVE
E4 - SELECT
E5 - PREV SCREEN
E6 - NEXT SCREEN
HELP - HELP
DO - DO
F6, F7, ..., - F6, F7, ..., F20
F20
4 – Examples
CDO> DEFINE KEY /TERMINATE PF3 "SHOW DEFAULT"
In this example, the DEFINE KEY command assigns the CDO SHOW
DEFAULT command to the PF3 key. CDO executes the SHOW DEFAULT
command when you press the PF3 key.