Run Action Icon

Hold Down Key Action

Declaration

<AMKEYDOWN SHIFT="yes/no" CTRL="yes/no" ALTGR="yes/no" ALT="yes/no" WINKEY="yes/no">

See Also

Send Keystrokes, Release Key, Mouse

Description

Holds the specified key(s) down until a "Release Key" <AMKEYUP> action is specified in the task. This action is only needed when a key or keys need to be held down during a mouse operation or across multiple steps. Otherwise the "Send Keystrokes" <AMSENDKEYS> action should be used as it supports special keys also.

Practical Usage

Generally the "Hold down key" action is used in conjunction with the Release Key Action <AMKEYUP> 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 Mouse <AMMOUSE> action steps, finally followed by a Release Key Action <AMKEYUP> step.

Parameters

General Tab

Shift
Yes/No, Optional Default NO
MARKUP: SHIFT="YES"

Specifies that the SHIFT key should be held down for all steps following in the task in the task until a similarly configured "Release Key" Action <AMKEYUP> step is encountered.

Ctrl
Yes/No, Optional Default NO
MARKUP: CTRL="YES"

Specifies that the CTRL key should be held down for all steps following in the task in the task until a similarly configured "Release Key" Action <AMKEYUP> step is encountered.

AltGr
Yes/No, Optional Default NO
MARKUP: ALTGR="YES"

Specifies that the ALTGR key (available on many international keyboard layouts) should be held down for all steps following in the task in the task until a similarly configured "Release Key" Action <AMKEYUP> step is encountered.

Alt
Yes/No, Optional Default NO
MARKUP: ALT="YES"

Specifies that the ALT key should be held down for all steps following in the task in the task until a similarly configured "Release Key" Action <AMKEYUP> step is encountered.

Winkey
Yes/No, Optional Default NO
MARKUP: WINKEY="YES"

Specifies that the WINKEY key (the key with the Microsoft Windows logo on it) should be held down for all steps following in the task in the task until a similarly configured "Release Key" Action <AMKEYUP> step is encountered.

Notes

Include a Release Keys Step in the Same Task
Not including a matching "Release Key Action <
AMKEYUP> step will result in the special key being held down for the rest of the Windows session causing strange results when clicking or typing.

Standard Error Handling Options
This action also includes the standard "Error Causes" and "On Error" failure handling options/tabs

More on Error Handling Options

Variables and Expressions
All text fields allow the use of expressions by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, a popup expression builder is available in all these fields by pressing F2.
More on variables...

More on expressions...

More on the expression builder...

Example

<AMKEYDOWN SHIFT="YES">

<AMKEYDOWN SHIFT="YES" CTRL="YES" ALTGR="YES">