Keyboard Commands


Enters text and special system keys through the keyboard. It simulates keystrokes through a number of methods (listed below).

The No Variable Expansion option is available in all keyboard types. If this option is chosen, system variables such as "{F1}", "{windir}", and "{newline}" will be typed literally, instead of being translated.

The available commands are:

  Type
  Text via Clipboard
  Direct Window Entry
  Block Input
  Unblock Input


*Tip:  Be sure to make use of the System Variables link which allows you to include useful system variables such as "{windir}", "{clipboard}", and "{backspace}"



  Type
 

Sends characters through the keyboard as if you had manually typed them. It appears to the system as if the keys were physically pressed on the keyboard. This is the default method of entry, since it works with all applications, and programs may be expecting characters to come in through the keyboard rather than programmatically.

Normally, vTask will type exactly the characters that you want, but in certain circumstances (usually related to hardware settings), you may want to directly control the output method. The following options are provided:

Type OptionDescription
Simulated Keypress
This option allows vTask to choose which is the best typing method. It uses the contents of the text and the hardware configuration to determine how to simulate the key presses. Typically, the chosen mode will be a combination of ASCII, ANSI, and OEM character codes.

This is the recommended method and default mode, and is used if no other mode is chosen.
SendKeys
Functions similar to the Visual Basic SendKeys command (1) (2) . This is a type method provided by Windows.

This method can be used with standard text, but may have limitations with international characters. As the Microsoft documentation states, "If your application is intended for international use with a variety of keyboards, the use of Send could yield unpredictable results and should be avoided."


The Inter-Character Delay allows you to control the typing speed. Some programs, such as Adobe PDF Reader, are not able to handle the fast output of vTask. This setting will pause between each letter, and thus provide a more "human-like" typing speed. For the fastest speed, use "0" (or leave this property blank). You may also use the {Delay=x} system variable to set inter-letter delays where needed.

You can use any text or special formatting, for example, system keys such as {tab}, directional keys such as {Left}, and system variables such as {clipboard}. See the System Variables section for more information.

There are certain rare circumstances where all the keypresses do not finish going through the keyboard buffer before the next step is run. This is usually due to 3rd-party software (or sometimes web-based edit field verifications, Yahoo email does this for example) that causes a slowdown in the processing of the keyboard buffer. In these situations, a Delay action can be added after the Simulate Keypress action to ensure that the typing of all characters is completed.

*Tip:  Certain programs behave differently depending on the text used. For example, MS Word 2003 ignores newlines when they are at the end of a line and no characters follow: "abc{linefeed}" (try pasting from Notepad into Word to confirm this oddity). MS Excel will try to auto-fill a cell if you start a newline with a space: "abc{return} ". Be aware of these behaviors when using the TYPE command.



  Text via Clipboard
 

Does not actually type characters, but instead pastes them through the clipboard. The previous clipboard contents are restored after typing.

This is the most foolproof method, however it is not recommended for common use since applications won't receive the keystroke messages that they might be expecting. (Note: this method does not use the WM_PASTE message, which is highly unreliable for various reasons).

Use this method as a backup in case you have trouble with the other methods.


  Direct Window Entry
 

Does not simulate any keystrokes, but directly places the text into the window via a system message (using SetWindowText/WM_SETTEXT).

This method is the least reliable, however it may be the only approach for special windows that don't allow typing (such as setting a window's title or entering text into a read-only field that is grayed out or disabled).

This action performs the same as the Set Text action.

Use this method if want to set a title or read-only field.


  Block Input
 

Prevents user input from the keyboard and mouse. The input will be blocked until the Unblock action is used.


  Unblock Input
 

Allows user input from the keyboard and mouse after using a Block Input action.