Encapsulates the AutoMate™ action in the “General” group, “Send keystrokes.” The method sends keystrokes to the currently focused window as if a user where typing them on the keyboard.
Declaration
function SendKeystrokes (varKeystrokes As Variant,
intPauseFirst As Integer,
intPauseLength As Integer) As Integer
Parameters
varKeystrokes
The keystrokes to send.
intPauseFirst
Specifies whether or not AutoMate™ should pause before sending the keystrokes. If set to “1”, AutoMate™ will pause for the number of milliseconds specified by PauseLength. If set to “0”, the PauseLength parameter is ignored.
intPauseLength
The number of milliseconds to wait before AutoMate™ attempts to send the keystrokes specified by varKeystrokes. This parameter is used only if intPauseFirst is “1.”
Description
The SendKeystrokes method will send keys to the currently focused application or window, mimicking a user at the keyboard. Use intPauseFirst and intPauseLength to specify if AutoMate™ should pause before attempting to send the keystrokes and for how long.
AutoMate™ does not do any checks before sending the keystrokes – it will blindly write to the keyboard buffer regardless of the current system state. Because of this, ensure that the proper window to receive the keyboard focus is selected (using the WindowFocus method) before using the SendKeystrokes method.