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.
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