Hold Down Key Action Icon

Hold Down Key

 

 

Declaration

<AMKEYDOWN SHIFT="Yes/No" ALT="Yes/No" CTRL="Yes/No" WINKEY="Yes/No" ALTGR="Yes/No" />

See Also

Check | Click Mouse | Get Selected List Item | Get Selected Tree Item | Get Text | Move Mouse | Move Mouse to Object | Press | Release Key | Select Item | Select List Item | Select Tree Item | Send Keystrokes | Set Text

Description

Holds the specified key(s) down until a Release Key action is specified in the task.

IMPORTANT: In 95% of cases, this action is not needed. The Send Keystrokes action 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 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 Move Mouse or Move Mouse to Object and Click Mouse steps, finally ending with a Release Key step.

Parameters

General Properties

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 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 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 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 Release Key step is encountered.

Winkey

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 Release Key step is encountered.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

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

 

<AMKEYDOWN SHIFT="YES" />

<AMMOUSEMOVEOBJECT WINDOWTITLE="Download AutoMate - Network Automation - Windows Internet Explorer" OBJECTNAME="Phone:" OBJECTCLASS="Internet Explorer_Server" OBJECTTYPE="SelectableText" CHECKOBJECTNAME="YES" CHECKOBJECTCLASS="YES" CHECKOBJECTTYPE="YES" />

<AMMOUSECLICK CLICK="double" />

<AMKEYUP SHIFT="YES" />

 

↑ Top of Page