Sends a set of keystrokes to the console.
ConsoleWindow.TypeKeys (sEvents [, nDelay, ensureFocus, sItemIdentifier])
Variable | Description |
---|---|
sEvents | The keystrokes to type. STRING. |
nDelay | Optional: The delay between keystrokes (in seconds and fractions of seconds). NUMBER. |
ensureFocus |
Optional: Whether the agent brings the application to the foreground and then sets the keyboard focus to the control on which the method is executed. This is executed before the first key is typed, which means it is not rechecked for each keystroke when you specify multiple keys to be typed. By default, this variable is set to TRUE. BOOLEAN. |
sItemIdentifier | The index of the console window or the caption of the window. If this parameter is left blank, Silk4NET sends the keystrokes to the first found console window. STRING. |
The following code sample executes the dir command in the console window to list the files and folders in the directory:
// VB ConsoleWindow.TypeKeys ("dir<Enter>")
// C# ConsoleWindow.TypeKeys ("dir<Enter>");