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.

Namespace: ScreenUPG
Assembly: ScreenUPG (in ScreenUPG.dll)


Visual Basic (Declaration)
Public Sub sendKeys( _ 
   ByVal inText As String,  _ 
   ByVal inType As Integer _ 
public void sendKeys(
   string inText,
   int inType
 void sendKeys(
   String inText,
   int inType
) sealed 
public void sendKeys(
   string inText,
   int inType
public  function sendKeys(
   inText : String,
   inType : int


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


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.



 Copy Code
            // 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);
 Copy Code
            'Send Transmit key at current cursor position
            screen.sendKeys "@E", &H20000
            'The next line is equivalent to the line above
            screen.sendKeys "{Transmit}", &H10000

See Also