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.

--by

No

Locator strategy. The default value is: NAME

--count

No

Number of taps to perform. The default value is: 1

--camera-by

No

Locator strategy for the camera. The default value is: NAME

--camera-value

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.

--by

No

Locator strategy. The default value is: NAME

--camera-by

No

Locator strategy for the camera. The default value is: NAME

--camera-value

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. Space, Return, Escape, A–Z, Alpha0–Alpha9).

--duration

No

How long to hold the key, in seconds. The default value is: 0.1

--power

No

Press power from 0.0 to 1.0. The default value is: 1.0

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.

--power

No

Press power from 0.0 to 1.0. The default value is: 1.0

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

--start-x

Yes

X coordinate of the swipe start point.

--start-y

Yes

Y coordinate of the swipe start point.

--end-x

Yes

X coordinate of the swipe end point.

--end-y

Yes

Y coordinate of the swipe end point.

--duration

No

Duration of the swipe gesture in seconds. The default value is: 0.5

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

--vertical

No

Vertical scroll amount. Positive values scroll up, negative values scroll down. The default value is: -1

--duration

No

Duration of the scroll in seconds. The default value is: 0.1

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

--x

Yes

Target X screen coordinate.

--y

Yes

Target Y screen coordinate.

--duration

No

Duration of the movement in seconds. The default value is: 0.1

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: begin, move, or end.

--x

Yes (begin, move)

X screen coordinate of the touch point.

--y

Yes (begin, move)

Y screen coordinate of the touch point.

--finger-id

No

The finger ID returned by a previous begin action. Pass it to move and end to target the same touch point. The default value is: 1

Returns

  • The finger ID (integer) assigned to the touch point on begin. Confirmation on move and end.

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