Browse docsoutput.set_touch
On this page
API method

output.set_touch

Overrides touchpad point 0 or 1 for this packet.

Syntax

Atlas Script
output.set_touch(index, x, y, active?, id?)

Parameters

index
Touch-point index. Use 0 or 1 to select the controller touch point to update.
x
Horizontal component or X coordinate for the requested operation.
y
Vertical component or Y coordinate for the requested operation.
active Optional
Boolean touch-point state. true emits this touch point and false leaves the selected point inactive for the current packet.
id Optional
Optional identifier used by this API to keep the selected touch point or drawing stable across calls. See Remarks for the method-specific accepted range or format.

Return value

See the remarks for the returned value and runtime behavior.

Remarks

Overrides touchpad point 0 or 1 for this packet. X clamps to 0-1920, Y to 0-1080, active defaults true, and id defaults 0 and clamps to -1 through 127. Both touch points are emitted.

Examples

Spoof a touch while held.atlas
event on_input() {
    if (input.held("L1")) {
        output.set_touch(0, 960, 540, true, 0);
    }
}
Reference details are generated from the Atlas Script schema in this documentation source snapshot. Confirm release-specific behavior in the Atlas for Windows build you use.