ScreenUPG
sendKeys Method
Example 



Keys to send to the session. This can be a combination of text characters and host keystrokes, however only one host keystroke can be sent in each call and the host keystroke must be the last key sent. Please see Key Codes for valid codes for each host type.
The format of the host keystrokes included in the string, either HLLAPI format or BRACES format
Sends characters and special keys to the session. They are treated the same as if they were typed at the keyboard. Special keystrokes can be specified in HLLAPI format, which has a special code for each keystroke, such as "@E" for the host Transmit key, or Braces format, where the key name is surrounded by braces, such as "{Transmit}". See Key Codes for a complete list of codes for each host type. You can also use sendKeys to send text character strings to the session. Text is sent to the host or written to the presentation space at the current cursor location. For example, to send the text "logoff" followed by the Transmit key, inText would be "logoff@T". If you are sending a lot of text to the presentation space, however, it may be more efficient to use putString or putStringEx instead. If an invalid key sequence is detected, no characters or keys are sent. It is recommended that you follow every sendKey call with a call to one of the wait methods (for example, WaitForString , WaitHostQuiet, or WaitForCursor). This helps to ensure that the host has completed processing before your application moves on to the next step.
Syntax
'Declaration
 
Public Sub sendKeys( _ 
   ByVal inText As String, _ 
   ByVal inType As Integer _ 
) 
'Usage
 
Dim instance As ScreenUPG 
Dim inText As String 
Dim inType As Integer 
  
instance.sendKeys(inText, inType)
public void sendKeys( 
   string inText,
   int inType 
)
public: 
void sendKeys( 
   String^ inText,
   int inType 
) 

Parameters

inText
Keys to send to the session. This can be a combination of text characters and host keystrokes, however only one host keystroke can be sent in each call and the host keystroke must be the last key sent. Please see Key Codes for valid codes for each host type.
inType
The format of the host keystrokes included in the string, either HLLAPI format or BRACES format
Remarks
Note: For VT sessions, keys are transmitted immediately to the host as processed, while for the other host types they are written to the presentation space or acted upon at the current cursor position.
Example
// Send Transmit key at current cursor position
screen.sendKeys("@E", ScreenUPG.KEYTYPE_HLLAPI);
            
// The next line is equivalent to the line above
screen.sendKeys("{Transmit}", screen.KEYTYPE_BRACES);
'Send Transmit key at current cursor position
screen.sendKeys "@E", &H20000
            
'The next line is equivalent to the line above
screen.sendKeys "{Transmit}", &H10000
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ScreenUPG Class
ScreenUPG Members
putString Method
putStringEx Method
waitForCursor Method
waitForString Method
waitHostQuiet Method
KEYTYPE_BRACES Property
KEYTYPE_HLLAPI Property