Runtime v2.81 · Updated Sep 30, 2026

swipe

Perform a swipe gesture from a flat list of SwipePoint values.

Syntax

swipe(points, *, parallel=False)

Parameters

NameDescription
pointslist[SwipePoint]
Flat path for one finger. Requires at least 2 points.
Required · Positional or named
No default
parallelBoolean
When True, returns a numeric touch id. In collect mode the swipe waits for Touch.send(); otherwise it queues immediately. Use Touch.cancel(id) or Touch.cancel() to cancel queued/active touches.
Optional · Keyword only
Default: False

Returns

Number | None — Returns a numeric id only when parallel=True; otherwise None.

Behavior / side effects

Perform a swipe gesture from a flat list of SwipePoint values. Each list creates one multi-point path for one finger.

Execution

  • Blocking: Conditional
  • Thread safety: Limited
  • Parallel execution: Conditional

Android gestures share the device. parallel=True queues a touch id but does not make delay_before or delay_after non-blocking outside collect mode. Within collect mode touches are collected for Touch.send(); Touch.wait() waits for their completion.

Example

path = [
    SwipePoint(Point(500, 1500), speed="FAST"),
    SwipePoint((560, 980), speed="NORMAL", humanized=True),
    SwipePoint(Point(500, 500))
]
swipe(path)

Touch.collect()
left = swipe(path, parallel=True)
right = swipe([
    SwipePoint(Point(780, 1500), speed="FAST"),
    SwipePoint(Point(780, 500))
], parallel=True)
Touch.send()
Touch.wait()

Errors / limitations

No additional limitations documented; follow the parameter and behavior contract above.

Related APIs