Runtime v2.81 · อัปเดต 30 ก.ย. 2569

swipe

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

รูปแบบคำสั่ง

swipe(points, *, parallel=False)

พารามิเตอร์

ชื่อคำอธิบาย
pointslist[SwipePoint]
Flat path for one finger. Requires at least 2 points.
จำเป็น · ระบุตามตำแหน่งหรือชื่อ
ไม่มีค่าเริ่มต้น
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.
ไม่บังคับ · ระบุชื่อเท่านั้น
ค่าเริ่มต้น: False

ค่าที่ส่งกลับ

Number | None — ส่งกลับรหัสตัวเลขเฉพาะเมื่อ Parallel=True; มิฉะนั้นไม่มี

พฤติกรรม / ผลข้างเคียง

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

การทำงาน

  • รอให้เสร็จ: ขึ้นอยู่กับเงื่อนไข
  • ความปลอดภัยเมื่อทำงานพร้อมกัน: มีข้อจำกัด
  • การทำงานแบบขนาน: ขึ้นอยู่กับเงื่อนไข

ท่าทาง Android ใช้อุปกรณ์ร่วมกัน parallel=True จัดคิว id การสัมผัส แต่ delay_before และ delay_after ยังทำให้รอนอกโหมด collect ในโหมด collect จะรวบรวมการสัมผัสเพื่อ Touch.send(); Touch.wait() รอจนเสร็จ

ตัวอย่าง

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

ข้อผิดพลาด / ข้อจำกัด

ไม่มีข้อจำกัดเพิ่มเติมที่ระบุไว้ ให้ปฏิบัติตามพารามิเตอร์และพฤติกรรมข้างต้น

API ที่เกี่ยวข้อง