Repository navigation
Description
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_tapcount, 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
feat(mcp): iphone_batch taps a run of keys in one gesture with one_ge…
feat(mcp): iphone_batch taps a run of keys in one gesture with one_ge…