Keyboard commands

Keyboard commands are a type of Interaction Expression. With keyboard commands, the Bot pretends to be a user: It navigates your application, typing on the keyboard.

Typically, you scan your application to create a Module and then use keyboard commands in the Steps that you create from this Module. Often, you will combine keyboard commands with click operations.

RPA Studio offers the following types of keyboard commands:

You can also steer entire windows rather than individual elements in a window.

To do so, use the Module Send Keys from the RPA subset.

Enter letters and numbers

To insert letters or numbers, simply enter the letters or numbers.

You can use uppercase or lowercase letters. RPA Studio interprets capital letters as SHIFT + lower case letters.

Enter Jane and Doe into two different text boxes

Some applications might not accept the input of several text characters at once.

In this case, use the syntax {TEXTINPUT["<Unicode characters>"]} to enter your text as Unicode characters.

Use single keyboard commands

To perform single keyboard commands, use the syntax {COMMAND}.

The following commands are available:

Command

Action

BACKSPACE

Backspace

BREAK

Break

CAPSLOCK

Caps Lock

CLEAR

Clear

DEL

Del

DOWN

END

End

ENTER

Enter

ESC

Esc

HELP

Help

HOME

Home

INSERT

Ins

LEFT

NUMLOCK

Num Lock

RETURN

RIGHT

SCROLLLOCK

Scroll Lock

TAB

Tab

UP

SHIFT, LSHIFT, RSHIFT

Shift, Left Shift, Right Shift

CTRL, LCTRL, RCTRL

Ctrl, Left Ctrl, Right Ctrl

ALT, LALT, RALT

Alt, Left Alt, Right Alt

F1 ... F24

F1 - F24

LWIN

Left Windows key

RWIN

Right Windows key

APPS

Windows context menu key

Use key combinations

This Expression allows you to perform more complex user interactions. It uses the WinForms function SendKeys.

To define a key combination in RPA Studio, use the syntax {SENDKEYS["<Microsoft SendKeys command>"]}.

For a list of available SendKeys commands and their syntax, see the Microsoft SendKeys documentation: http://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys.aspx

The double quotation marks " that enclose the SendKeys command escape any special characters within the command. If your command contains double quotation marks as a special character, you need additional escaping. For more information on working with special characters, see "Use special characters".

Let's say you want your Bot to highlight the entire value of a text box with CTRL + A and then delete it.

In this case, you first need to allow the Bot to re-use the same control multiple times (see "Use controls repeatedly").

In your Step, define the following Step Values:

Keyboard commands for the text box Order

  • The value in the first Order Step Value highlights the content of the text box.

  • The value in the second Order Step Value deletes it.

In some cases, your application may need some time to process between commands.

You can add the special task configuration parameter SendKeysDelay or the steering parameter SendKeysDelay to specify a delay in milliseconds.

If you have specified both, the steering parameter takes precedence.

Simulate keyboard entries

This Expression allows you to simulate keyboard entries by using Microsoft virtual-key codes.

To use virtual-key codes in your Expressions, use the syntax {KEYPRESS[<Microsoft Virtual-key code>]}.

For a list of available virtual-key codes, see the Microsoft virtual-key codes documentation: http://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx

Enter virtual-key codes in RPA Studio without the prefix VK_.

For instance: {KEYPRESS[RETURN]} instead of VK_RETURN.

If you want to perform key combinations, use the syntax {KEYDOWN[Virtual-key code]} for pressing the key and {KEYUP[Virtual-key code]} for releasing it.

Let's say you want your Bot to highlight the entire value of a text box with CTRL + A and then delete it.

In this case, you need to define the following Step Value:

Virtual-key commands for text box Order

  • {KEYDOWN[CONTROL]} presses down the CTRL key

  • {KEYPRESS[A]} presses A

  • {KEYUP[CONTROL]} releases CTRL and A

  • {KEYPRESS[DELETE]} presses the DEL key

Was this information helpful?

Tricentis RPA Studio Manual 2020.2 © Tricentis GmbH