Input actions#
Commands that tap, click, type, swipe and scroll in the app.
Every command also takes the global options, such as --host and --port.
tap#
Taps on an object. Use for mobile and touch interactions.
Parameters
Name |
Required |
Description |
|---|---|---|
value |
Yes |
The object name or locator value. |
|
No |
Locator strategy. The default value is: |
|
No |
Number of taps to perform. The default value is: |
|
No |
Locator strategy for the camera. The default value is: |
|
No |
Camera locator value. |
Returns
Game state snapshot.
Examples
alttester tap PlayButton
alttester tap PlayButton --count 2
alttester tap --by PATH //Canvas/Menu/StartButton
click#
Clicks on an object. Use for desktop interactions.
Parameters
Name |
Required |
Description |
|---|---|---|
value |
Yes |
The object name or locator value. |
|
No |
Locator strategy. The default value is: |
|
No |
Locator strategy for the camera. The default value is: |
|
No |
Camera locator value. |
Returns
Game state snapshot.
Examples
alttester click PlayButton
press#
Presses a keyboard key.
Parameters
Name |
Required |
Description |
|---|---|---|
key |
Yes |
The key code to press (e.g. |
|
No |
How long to hold the key, in seconds. The default value is: |
|
No |
Press power from 0.0 to 1.0. The default value is: |
Returns
Confirmation.
Examples
alttester press Space
alttester press Return
alttester press W --duration 2.0
key-down#
Presses and holds a keyboard key without releasing it. Useful for key combinations; pair with key-up to release.
Parameters
Name |
Required |
Description |
|---|---|---|
key |
Yes |
The key code to hold down. |
|
No |
Press power from 0.0 to 1.0. The default value is: |
Returns
Confirmation.
Examples
alttester key-down LeftShift
alttester press A
alttester key-up LeftShift
key-up#
Releases a previously held key.
Parameters
Name |
Required |
Description |
|---|---|---|
key |
Yes |
The key code to release. |
Returns
Confirmation.
Examples
alttester key-up LeftShift
swipe#
Swipes between two screen coordinates.
Parameters
Name |
Required |
Description |
|---|---|---|
|
Yes |
X coordinate of the swipe start point. |
|
Yes |
Y coordinate of the swipe start point. |
|
Yes |
X coordinate of the swipe end point. |
|
Yes |
Y coordinate of the swipe end point. |
|
No |
Duration of the swipe gesture in seconds. The default value is: |
Returns
Confirmation.
Examples
alttester swipe --start-x 100 --start-y 500 --end-x 100 --end-y 200 --duration 0.5
scroll#
Scrolls using the mouse wheel.
Parameters
Name |
Required |
Description |
|---|---|---|
|
No |
Vertical scroll amount. Positive values scroll up, negative values scroll down. The default value is: |
|
No |
Duration of the scroll in seconds. The default value is: |
Returns
Confirmation.
Examples
alttester scroll --vertical 3 # Scroll up
alttester scroll --vertical -3 # Scroll down
move-mouse#
Moves the mouse cursor to a screen position.
Parameters
Name |
Required |
Description |
|---|---|---|
|
Yes |
Target X screen coordinate. |
|
Yes |
Target Y screen coordinate. |
|
No |
Duration of the movement in seconds. The default value is: |
Returns
Confirmation.
Examples
alttester move-mouse --x 200 --y 300
touch#
Manages a multi-touch gesture with explicit begin, move, and end phases.
Parameters
Name |
Required |
Description |
|---|---|---|
action |
Yes |
The touch phase: |
|
Yes (begin, move) |
X screen coordinate of the touch point. |
|
Yes (begin, move) |
Y screen coordinate of the touch point. |
|
No |
The finger ID returned by a previous |
Returns
The finger ID (integer) assigned to the touch point on
begin. Confirmation onmoveandend.
Examples
alttester touch begin --x 100 --y 200 # Returns a finger-id
alttester touch move --x 150 --y 250 --finger-id 1
alttester touch end --finger-id 1
reset-input#
Resets all active input operations to a neutral state.
Parameters
No parameters.
Returns
Confirmation.
Examples
alttester reset-input