Input - Hold key

Declaration

<AMINPUT ACTIVITY="hold_key" SHIFT="YES/NO" ALT="YES/NO" CTRL="YES/NO" WINKEY="YES/NO" ALTGR="YES/NO" />

Related Topics

Description

Holds the specified keys down until a Input - Release key step is encountered.

NOTE: In most cases, this action is not needed. The Input - Send keystrokes activity can hold down keystrokes for simple key combinations such as ALT+F. This action is only needed when one or more keys need to be held down during a mouse operation or across multiple steps. Otherwise the Send Keystrokes action should be used as it supports holding down of special keys also.

Practical usage

Generally used in conjunction with the Input - Release key action to hold down special keys spanning multiple steps. For example if the application being automated requires that the ALT key be held down while mouse clicks are taking place, that task could begin with this step to hold down the ALT key, followed by the Input - Move mouse or Interactivity - Move mouse to object and Input - Click mouse steps, finally ending with a Input - Release key step.

Parameters

General

Property Type Required Default Markup Description
Shift Yes/No No No SHIFT="YES" Indicates that the SHIFT key should be held down for this and all steps following in the task until a Input - Release key step is encountered.
Ctrl Yes/No No No CTRL="YES" Indicates that the CTRL key should be held down for this and all steps following in the task until a Input - Release key step is encountered.
Alt Gr Yes/No No No ALTGR="YES" Indicates that the ALTGR key (available on many international keyboard layouts) should be held down for this and all steps following in the task until a Input - Release key step is encountered.
Alt Yes/No No No ALT="YES" Indicates that the ALT key should be held down for this and all steps following in the task until a Input - Release key step is encountered.
Windows Key Yes/No No No WINKEY="YES" Indicates that the Winkey (Windows start key with the Microsoft Windows logo on it) should be held down for this and all steps following in the task until a Input - Release key step is encountered.

Description

Error Causes

On Error

Example

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

This sample task displays usage of a Hold Down Key and Release Key actions.

Copy
<AMINPUT ACTIVITY="hold_key" SHIFT="YES" />
<AMINTERACT ACTIVITY="mouse_to_object" WINDOWTITLE="Home - BBC News - Internet Explorer" OBJECTPROPERTIES="Toolkit=UIAutomation,Type=50020,Class=,FrameworkId=,Name=UK,AutomationId=,Value=https://www.bbc.co.uk/news/uk,ParentPath=50032|50033|50033|50033|50033|50004|50004|50008|50007|50005|50020,Occurrence=,X=,Y=" />
<AMINPUT ACTIVITY="click_mouse" CLICK="double" />
<AMINPUT ACTIVITY="release_key" SHIFT="YES" />