User`s guide

lxviii Contents
Send Key—Function 3
This function sends one or more keystrokes (up to a maximum of 255) to the connected Host session.
The keystrokes appear to the session as if they are entered by a user. The keystrokes can include host
function keys and AID keys.
Prerequisite Functions
Connect Presentation Space (function 1).
WinHLLAPI(SENDKEY,lpbyString,lpwLength,lpwReturnnCode)
Parameter Description
Data String String of keystrokes, maximum of 255 bytes (including
host function key codes).
Data Length Length of Data String in bytes. This parameter is
overridden if in EOT mode.
Code Description
WHLLOK The keystrokes were sent successfully.
WHLLNOTCONNECTED Your Windows HLLAPI application is not currently
connected to a Host session.
WHLLPARAMETERERROR The function call contains an invalid parameter.
WHLLPSBUSY The session is busy; all of the keystrokes could not be sent.
WHLLINHIBITED Input to the session is inhibited; keystrokes were rejected
or invalid host function key codes were sent. All of the
keystrokes could not be sent.
WHLLSYSERROR The function failed due to a system error.
You cannot send keystrokes to the Host session when the keyboard is locked or busy (input inhibited).
You can check the keyboard status with Wait (function 4). It is also your responsibility to treat input-
protected or numeric-only Host fields appropriately.
This function is affected by five session options specified by Set Session Parameters (function 9):
AUTORESET/NORESET, STRLEN/STREOT, EOT=c, and ESC=c.
You can increase the performance of the Send Key function by setting the session option NORESET. If
this session option is set to AUTORESET, a reset code is always added to the beginning of the
keystroke string, resetting all states that can be reset (except input-inhibited states). The added reset
code bytes are not deducted from the Data String length of 255.
By default, the length of the Data String parameter must be specified by the Data Length parameter.
Optionally, you can implicitly define the Data Length parameter by using the EOT delimiter character,
which is specified with Set Session Parameters (function 9).
Better character transfer performance is achieved with Copy String To Field
(function 33) or Copy String To Presentation Space (function 15). However, only
this function (Send Key) can send the host function keys.
This function can be used to send host function keys (including AID keys) to the Host by using special
codes. These codes consist of an Escape character (default is “@,” the “at” sign) and a mnemonic code
that corresponds to the supported host functions. The desired host function key codes are included as
Function Call
Call Parameters
Return Codes
Remarks
Note