SYSTOOLS DEFINE/KEY
Defines a key to execute a command. This enables you
to press a key to enter a command instead of typing the
command name.
Format
SYSTOOLS DEFINE/KEY key-name "string"
Parameters
key-name
Specifies the name of the key you are defining. Use the
following key names when defining keys:
Key Name VT100 VT52 LK201
"string"
Specifies the string you want entered when you press the
defined key. "String" can be a SYSTOOLS command, for
example, DIRECTORY or SET FILE.
Qualifiers
/ECHO
/NOECHO
Specifies whether the command line is visible on the screen
after you press the defined key. You cannot define a key
specifying both the /NOECHO and /NOTERMINATE quali-
fiers. The default qualifier is /ECHO.
/IF_STATE=state_list
/NOIF_STATE
Specifies a list of states, any one of which must be set in order
to enable the specified key definition. If you omit or negate
this qualifier, the current state prevails.
States are used to increase the number of key definitions
available on your terminal. The same key can be assigned
any number of definitions as long as each definition is as-
sociated with a different state. State names can be any
alphanumeric string.
/LOCK_STATE
/NOLOCK_STATE
Retains the state specified by the /SET_STATE qualifier un-
til you use the /SET_STATE qualifier again to change it. The
default qualifier is /NOLOCK_STATE.
States are used to increase the number of key definitions
available on your terminal. The same key can be assigned
any number of definitions as long as each definition is as-
sociated with a different state. State names can be any
alphanumeric string.
/LOG
/NOLOG
Specifies whether informational messages are displayed.
These messages signal successfully created key definitions.
The default qualifier is /LOG.
/SET_STATE=state
/NOSET_STATE
Associates a state with the key you are defining. A state
name can be any alphanumeric string. If you omit or negate
this qualifier, the current state remains unchanged. You
cannot define a key specifying both the /SET_STATE and
/TERMINATE qualifiers.
States are used to increase the number of key definitions
available on your terminal. The same key can be assigned
any number of definitions as long as each definition is associ-
ated with a different state.
/TERMINATE
/NOTERMINATE (default)
Determines whether the specified command string ex-
ecutes when you press the key. When you use the
/NOTERMINATE qualifier, you must press the Return
key to execute the command string. You cannot define a
key specifying both the /SET_STATE and /TERMINATE
qualifiers.
Examples
1.
SYSTOOLS> DEFINE/KEY PF1 "DIRECTORY"
This example shows how to define the keypad key PF1 as
the DIRECTORY command. To enter the DIRECTORY
command, press PF1 followed by the Return key.
2.
SYSTOOLS> DEFINE/KEY KP6 "EDIT" /TERMINATE
This example shows how to define the keypad key 6
(KP6) as the EDIT command. The /TERMINATE quali-
fier causes the EDIT command to execute when you press
KP6; you do not have to press the Return key.
3.
SYSTOOLS> DEFINE/KEY PF2 "SET "/SET_STATE=ALTERED
SYSTOOLS> DEFINE/KEY PF3 "FILE" /IF_STATE=ALTERED /TERMINATE
In this example, the PF2 key is defined as the SET com-
mand, with the state name ALTERED. Then, the PF3
key is defined to output the string FILE when the state
ALTERED is specified.
The /TERMINATE qualifier is used to end the command
line. When you specify the /TERMINATE qualifier, you
can avoid pressing the Return key to execute the com-
mand line. After you define PF2 and PF3, you can use
them together. Press PF2 to produce the first half of
the command line (SET) and press PF3 to finish the
command line (FILE).
4.
SYSTOOLS> DEFINE/KEY PF4 "SET " /SET_STATE=ALTERED
SYSTOOLS> DEFINE/KEY KP7 "FILE" /TERMINATE /IF_STATE=ALTERED
SYSTOOLS> DEFINE/KEY KP8 "FORWARD" /TERMINATE /IF_STATE=ALTERED
SYSTOOLS> DEFINE/KEY KP9 "WASTEBASKET" /TERMINATE /IF_STATE=ALTERED
This example shows how to define four different keys and
associate them with a state named ALTERED:
1. The first definition defines the key PF4 as the SET
command and associates this key with a state named
ALTERED.
2. The second definition defines the keypad key 7 as
"FILE" and makes it dependent on a state named
ALTERED. When you press PF4 followed by keypad
key 7, SYSTOOLS executes the SET FILE command.
3. The third definition defines keypad key 8 as
"FORWARD" and also makes it dependent on the
ALTERED state. When you press PF4 followed
by keypad key 8, SYSTOOLS executes the SET
FORWARD command.
4. The fourth definition defines keypad key 9 as
"WASTEBASKET" and also makes it dependent
on the ALTERED state. When you press PF4 fol-
lowed by keypad key 9, SYSTOOLS executes the SET
WASTEBASKET command.