key({keyname | command | $variable})
Where:
keyname | is the name of the key on the host keyboard. |
command | is the name of a system command. This parameter allows TN3270 Plus menu commands to be issued from within a script. |
$variable | is a variable. The text defined for the variable is substituted for the variable name and used as the command parameter. |
The key command specifies the key to be simulated. The complete list of keynames can be found in the Keyboard Map Setup dialog box. To display the Keyboard Map Setup dialog box, open the Setup menu, select Sessions... from Setup Items choose Keyboard and then click the Configure... button. Select Terminal Keys in the Function Group drop-down list box.
You may also consult the default keyboard maps in this help file:
Default VT100/VT220 Keyboard Map
For VT100, VT220 and ANSI terminal emulation sessions, you can also send "Ctrl+A" through "Ctrl+Z" . For example, to send "Ctrl+A" you would use the following command. Note that the "Ctrl+A" is case sensitive.
key(Ctrl+A)
The key command can also issue a system command from within a script. The complete list of system commands can be found in the Keyboard Map Setup dialog box. To display the Keyboard Map Setup dialog box, open the Setup menu, select Sessions... from Setup Items choose Keyboard and then click the Configure... button. Select System Commands in the Function Group drop-down list box.
Examples (3270)
key(enter)
key(tab)
key(PA2)
key(PF1)
key($KEY)
key(HostExit) 'Exit TN3270 Plus
Examples (5250)
key(enter)
key(tab)
key(RollDown/PageUp)
key(F1)
Examples (VT100/VT220)
key(enter)
key(tab)
key(PageUp)
key(F1)
key(Ctrl+A)
Examples (System Commands)
key(EditCopy) 'Copy selected data to the clipboard
key(EditPaste) 'Paste data into a session
key(EditSelectionLeft) 'Select the character left of the cursor
key(HostClose) 'Close the session
Key(HostEnableLogging) 'Enable terminal session activity logging
key(HostExit) 'Exit TN3270 Plus
key(HostPrintScreen) 'Print the current screen
Sample Script
'The following script types "this is a test" and then "presses" the enter key.
'
type("this is a test")
key(enter)
exit
See Also:
TN3270 Plus is continually being improved. To learn more about the latest enhancements, please review our Version History web page.