swipe

Move one finger through the SwipePoint values in order. By default, wait for the swipe to finish before continuing.

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
True: queue the swipe without waiting for completion. After Touch.collect(), wait for Touch.send(). Cancel with Touch.cancel(id), or cancel all with Touch.cancel().
Optional · Keyword only
Default: False

Returns

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

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()