Skip to content

iphone_batch: tap a sequence of keys in one gesture (one_gesture) #142

Closed

Description

@cosinec

What are you trying to do / 想做什么

Type into a text field that doesn't take iphone_type_text. Some fields inside in-app web views ignore /wda/keys and setting the element value at any typing speed; the only thing that works is tapping the keys on the on-screen keyboard one by one. With iphone_batch and one iphone_tap per key, each step waits for the interface to go idle, so a 7-digit number takes about 3.6 s and 20 digits about 9.6 s (iPhone 12 mini, iOS 26.4.1).

Proposed solution / 建议的做法

An optional one_gesture: true on iphone_batch, allowed only when every step is iphone_tap: the daemon sends the points as one W3C actions gesture, one touch pointer per point. Pointer k pauses through the ticks of the earlier points (move, down, 50 ms press, up, 40 ms gap), then taps its own point, so the presses come strictly one after another and never overlap. No idle wait in between, same quick idle settings as iphone_tap.

Measured on the Spotlight keyboard (field cleared before each run and read back through WDA afterwards):

keys per-step iphone_batch one_gesture correct
7 digits 3.61 s 1.91 s 5/5 both
16 digits 7.70 s 3.76 s 3/3 both
20 digits (repeated pairs 1122…) 9.61 s 4.63 s 3/3 both
10 letters – 2.56 s 3/3

Nothing is checked between taps, so it's meant for keys on one keyboard, and the description says to check the result afterwards. A batch that mixes in any other step is an error before anything runs. Without WDA it falls back to HID taps one by one.

Alternatives considered / 考虑过的其他办法

  • One pointer moving between the points in one gesture (like iphone_tap count, feat(mcp): iphone_tap taps the same point several times with count #141, but with moves): every key registered twice (7 keys gave 14 digits). One pointer per point is what makes it work.
  • Gap 0 ms between pointers: keys get lost or garbled. 20–60 ms all gave correct results; 40 ms is the default.
  • reuse_elements: saves the element lookup, not the idle wait per tap, so it doesn't help coordinate taps.

I have a branch with this, unit tests and the device runs above; I'll open a PR that links here.

Activity

  1. added a commit that references this issue on Nov 17, 2026
    76f7ac3
  2. added a commit that references this issue on Nov 17, 2026
    b6dbe9d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions