1 /KEY
Assigns a command string to a function key. For example, you can assign the LATCP SHOW NODE command to a function key. Format DEFINE/KEY key-name equivalence-string
1.1 – Parameters
key-name Specifies the name of the function key that you want to define. Valid key names are as follows: LK201/LK401 Key Name Keyboards VT100-Type VT52-Type PF1 PF1 PF1 Blue PF2 PF2 PF2 Red PF3 PF3 PF3 Black PF4 PF4 PF4 KP0-KP9 Keypad 0-9 Keypad 0-9 Keypad 0-9 PERIOD Keypad period (.) Keypad period (.) COMMA Keypad comma (,) Keypad comma (,) MINUS Keypad minus (-) Keypad minus (-) Enter Enter Enter Enter FIND Find - - INSERT_HERE Insert Here - - REMOVE Remove - - SELECT Select - - PREV_SCREEN Prev Screen - - (LK201) Prev (LK401) NEXT_SCREEN Next Screen - - (LK201) Next (LK401) HELP Help - - DO Do - - F6-F20 F6-F20 - - equivalence-string Specifies the command string that you want assigned to the function key. To preserve spaces and lowercase characters, enclose the string in quotation marks (" ").
1.2 – Qualifiers
1.2.1 /ECHO
/ECHO /NOECHO Specifies whether LATCP displays the command string on your screen when you press the key. If you do not specify the /ECHO or /NOECHO qualifier, the default is that the command string will be displayed. You cannot use /NOECHO with the /NOTERMINATE qualifier.
1.2.2 /IF_STATE
/IF_STATE=state-name Specifies the state that must be set (for example, the GOLD state) for the key definition to work. Lets you assign alternative meanings to keys when the specified state is set. See the discussion of the /SET_STATE qualifier. If you omit the /IF_STATE qualifier, LATCP uses the current state. The state name is an alphanumeric string. States are established with the /SET_ STATE qualifier.
1.2.3 /LOCK_STATE
/LOCK_STATE /NOLOCK_STATE Specifies that the state set by the /SET_STATE qualifier remain in effect until explicitly changed. If you use the /NOLOCK_STATE qualifier, the state set by /SET_STATE remains in effect only for the next definable key that you press or for the next read- terminating character (such as Return or Ctrl/Z) that you type. You can specify the /LOCK_STATE qualifier only with the /SET_ STATE qualifier. If you do not specify the /LOCK_STATE or /NOLOCK_STATE qualifier, the default is that the state set by the /SET_STATE qualifier remains in effect until explicitly changed.
1.2.4 /LOG
/LOG /NOLOG Specifies whether LATCP displays a message confirming that the command was executed. If you do not specify the /LOG or /NOLOG qualifier, the default is that no message will be displayed.
1.2.5 /SET_STATE
/SET_STATE=state-name Causes the specified state to be set when you press the defined key. The state name can be any alphanumeric string (for example, GOLD). Use the DEFINE/KEY/IF_STATE=state-name command to associate new meanings for keys when the specified state is set. See the example for the DEFINE/KEY command. If you omit the /SET_STATE qualifier, the current state that was locked remains in effect.
1.2.6 /TERMINATE
/TERMINATE /NOTERMINATE Specifies whether the command string will be terminated (processed) when you press the function key. The default is /NOTERMINATE, which allows you to press other keys before the command string is processed. Pressing Return has the same effect as using /TERMINATE. 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.
1.3 – Example
LATCP> DEFINE/KEY PF4 "SHOW NODE " /NOTERMINATE/SET_STATE=GOLD LATCP> DEFINE/KEY PF4 "/ALL"/IF_STATE=GOLD/TERMINATE The first DEFINE/KEY command in this example assigns the SHOW NODE command to function key PF4. To process the SHOW NODE command, you must press Return after pressing PF4. Note the space after the word NODE in the first DEFINE/KEY command. This space allows you to enter a node name after pressing PF4. When you press Return, the SHOW NODE command is processed. If the space is omitted, LATCP does not recognize the command (SHOW NODE). The state is set to GOLD; that state will be in effect for the next key that you press. The second DEFINE/KEY command defines the use of the PF4 key when the keypad is in the GOLD state. When you press PF4 twice, the SHOW NODE/ALL command is processed.