Runtime v2.81 · Na-update noong Set 30, 2026

Touch

Static helper for parallel click/swipe actions created by the UI or code via click(..., parallel=True) and swipe(..., parallel=True).

Syntax

Touch

Hindi direktang makakagawa ng instance ng class na ito.

Mga parameter

Wala

Ibinabalik na halaga

—

Pagkilos / epekto

Static helper for parallel click/swipe actions created by the UI or code via click(..., parallel=True) and swipe(..., parallel=True). You can collect click/swipe actions and send them together, or inspect click/swipe actions that are active or queued. The helper also supports cancelling active click/swipe actions (Android 8.0+ only).

Pagpapatakbo

  • Naghihintay matapos: May kondisyon
  • Kaligtasan ng sabayang paggamit: May limitasyon
  • Sabayang pagpapatakbo: May kondisyon

Pinagsasaluhan ng mga Android gesture ang device. Naglalagay sa queue ng touch id ang parallel=True, pero naghihintay pa rin ang delay_before at delay_after sa labas ng collect mode. Sa collect, iniipon ang mga touch para sa Touch.send(); hinihintay ng Touch.wait() ang pagtatapos.

Halimbawa

Touch.collect()
a = click(Point(300, 900), hold_ms=5000, parallel=True)
b = click(Point(780, 900), hold_ms=1000, delay_before=1000, parallel=True)
sent = Touch.send()
Touch.cancel(a)
Touch.wait()

Mga error / limitasyon

Walang karagdagang limitasyong nakadokumento; sundin ang mga parameter at pagkilos sa itaas.

Mga kaugnay na API

Mga method

7 method

Touch.collect

Enable collect mode for click/swipe calls with parallel=True.

Syntax

Touch.collect()

Mga parameter

Wala

Ibinabalik na halaga

None

Pagkilos / epekto

Enable collect mode for click/swipe calls with parallel=True. When enabled, parallel click/swipe calls are not sent immediately; they are collected and only sent after Touch.send(). This method works for both UI/code. If Touch.collect() is not enabled, parallel click/swipe calls are sent immediately, and later click/swipe calls must wait for the previous click/swipe to finish before they can run because running a later click/swipe immediately would cancel the previous one. You can intentionally cancel the previous click/swipe with Touch.cancel().

Pagpapatakbo

  • Naghihintay matapos: Hindi
  • Kaligtasan ng sabayang paggamit: May limitasyon
  • Sabayang pagpapatakbo: May kondisyon

Hindi hinihintay ng collect/send at state query ang pagtatapos ng gesture. Sa Touch.send() lang napupunta sa executor ang collected command; maaaring magbago agad ang queue snapshot.

Halimbawa

# Suriin o kontrolin ang mga nakolektang touch
Touch.collect()
first = click((300, 900), hold_ms=1000, parallel=True)
second = click((780, 900), delay_before=300, parallel=True)
Touch.send()
Touch.wait()

Mga error / limitasyon

Walang karagdagang limitasyong nakadokumento; sundin ang mga parameter at pagkilos sa itaas.

Mga kaugnay na API

Touch.send

Send all click/swipe calls collected by Touch.collect() at once, return their matching numeric ids, then turn off Touch.collect() collection mode.

Syntax

Touch.send()

Mga parameter

Wala

Ibinabalik na halaga

list[Number]

Pagkilos / epekto

Send all click/swipe calls collected by Touch.collect() at once, return their matching numeric ids, then turn off Touch.collect() collection mode.

Pagpapatakbo

  • Naghihintay matapos: Hindi
  • Kaligtasan ng sabayang paggamit: May limitasyon
  • Sabayang pagpapatakbo: May kondisyon

Hindi hinihintay ng collect/send at state query ang pagtatapos ng gesture. Sa Touch.send() lang napupunta sa executor ang collected command; maaaring magbago agad ang queue snapshot.

Halimbawa

# Suriin o kontrolin ang mga nakolektang touch
Touch.collect()
first = click((300, 900), hold_ms=1000, parallel=True)
second = click((780, 900), delay_before=300, parallel=True)
Touch.send()
Touch.wait()

Mga error / limitasyon

Walang karagdagang limitasyong nakadokumento; sundin ang mga parameter at pagkilos sa itaas.

Mga kaugnay na API

Touch.queued

Return touch states currently in the queue.

Syntax

Touch.queued()

Mga parameter

Wala

Ibinabalik na halaga

list[TouchState]

Pagkilos / epekto

Return touch states currently in the queue.

Pagpapatakbo

  • Naghihintay matapos: Hindi
  • Kaligtasan ng sabayang paggamit: May limitasyon
  • Sabayang pagpapatakbo: May kondisyon

Hindi hinihintay ng collect/send at state query ang pagtatapos ng gesture. Sa Touch.send() lang napupunta sa executor ang collected command; maaaring magbago agad ang queue snapshot.

Halimbawa

# Suriin o kontrolin ang mga nakolektang touch
Touch.collect()
first = click((300, 900), hold_ms=1000, parallel=True)
second = click((780, 900), delay_before=300, parallel=True)
Touch.send()
print(Touch.queued())
Touch.wait()

Mga error / limitasyon

Walang karagdagang limitasyong nakadokumento; sundin ang mga parameter at pagkilos sa itaas.

Mga kaugnay na API

Touch.active

Return active touch states.

Syntax

Touch.active()

Mga parameter

Wala

Ibinabalik na halaga

list[TouchState]

Pagkilos / epekto

Return active touch states.

Pagpapatakbo

  • Naghihintay matapos: Hindi
  • Kaligtasan ng sabayang paggamit: May limitasyon
  • Sabayang pagpapatakbo: May kondisyon

Hindi hinihintay ng collect/send at state query ang pagtatapos ng gesture. Sa Touch.send() lang napupunta sa executor ang collected command; maaaring magbago agad ang queue snapshot.

Halimbawa

# Suriin o kontrolin ang mga nakolektang touch
Touch.collect()
first = click((300, 900), hold_ms=1000, parallel=True)
second = click((780, 900), delay_before=300, parallel=True)
Touch.send()
print(Touch.active())
Touch.wait()

Mga error / limitasyon

Walang karagdagang limitasyong nakadokumento; sundin ang mga parameter at pagkilos sa itaas.

Mga kaugnay na API

Touch.all

Return recent and queued/active touch states.

Syntax

Touch.all()

Mga parameter

Wala

Ibinabalik na halaga

list[TouchState]

Pagkilos / epekto

Return recent and queued/active touch states.

Pagpapatakbo

  • Naghihintay matapos: Hindi
  • Kaligtasan ng sabayang paggamit: May limitasyon
  • Sabayang pagpapatakbo: May kondisyon

Hindi hinihintay ng collect/send at state query ang pagtatapos ng gesture. Sa Touch.send() lang napupunta sa executor ang collected command; maaaring magbago agad ang queue snapshot.

Halimbawa

# Suriin o kontrolin ang mga nakolektang touch
Touch.collect()
first = click((300, 900), hold_ms=1000, parallel=True)
second = click((780, 900), delay_before=300, parallel=True)
Touch.send()
print(Touch.all())
Touch.wait()

Mga error / limitasyon

Walang karagdagang limitasyong nakadokumento; sundin ang mga parameter at pagkilos sa itaas.

Mga kaugnay na API

Touch.wait

Wait for one numeric id, or every queued/active touch when id is None.

Syntax

Touch.wait(id=None)

Mga parameter

Wala

Ibinabalik na halaga

TouchState | list[TouchState]

Pagkilos / epekto

Wait for one numeric id, or every queued/active touch when id is None.

Pagpapatakbo

  • Naghihintay matapos: Oo
  • Kaligtasan ng sabayang paggamit: May limitasyon
  • Sabayang pagpapatakbo: May kondisyon

Naghihintay sa tumawag na flow hanggang matapos ang tagal o touch. Maaaring magpatuloy ang ibang flow; umiiral pa rin ang pause at stop.

Halimbawa

# Suriin o kontrolin ang mga nakolektang touch
Touch.collect()
first = click((300, 900), hold_ms=1000, parallel=True)
second = click((780, 900), delay_before=300, parallel=True)
Touch.send()
Touch.wait(first)
Touch.wait()

Mga error / limitasyon

Walang karagdagang limitasyong nakadokumento; sundin ang mga parameter at pagkilos sa itaas.

Mga kaugnay na API

Touch.cancel

Cancel one queued or active touch by numeric id.

Syntax

Touch.cancel(id=None)

Mga parameter

Wala

Ibinabalik na halaga

Boolean | Int

Pagkilos / epekto

Cancel one queued or active touch by numeric id. When id is None, cancels every queued/active touch and returns the accepted cancel count. Active cancel requires Android 8.0+; Android 7.x scripts fail with a clear error when an active touch is targeted.

Pagpapatakbo

  • Naghihintay matapos: May kondisyon
  • Kaligtasan ng sabayang paggamit: May limitasyon
  • Sabayang pagpapatakbo: May kondisyon

Pinagsasaluhan ng mga Android gesture ang device. Naglalagay sa queue ng touch id ang parallel=True, pero naghihintay pa rin ang delay_before at delay_after sa labas ng collect mode. Sa collect, iniipon ang mga touch para sa Touch.send(); hinihintay ng Touch.wait() ang pagtatapos.

Halimbawa

# Suriin o kontrolin ang mga nakolektang touch
Touch.collect()
first = click((300, 900), hold_ms=1000, parallel=True)
second = click((780, 900), delay_before=300, parallel=True)
Touch.send()
# Kailangan ng Android 8 pataas para kanselahin ang aktibong operasyon
Touch.cancel(second)
Touch.wait()

Mga error / limitasyon

Walang karagdagang limitasyong nakadokumento; sundin ang mga parameter at pagkilos sa itaas.

Mga kaugnay na API