MCPcopy
hub / github.com/zai-org/Open-AutoGLM / tap

Function tap

phone_agent/hdc/device.py:80–102  ·  view source on GitHub ↗

Tap at the specified coordinates. Args: x: X coordinate. y: Y coordinate. device_id: Optional HDC device ID. delay: Delay in seconds after tap. If None, uses configured default.

(
    x: int, y: int, device_id: str | None = None, delay: float | None = None
)

Source from the content-addressed store, hash-verified

78
79
80def tap(
81 x: int, y: int, device_id: str | None = None, delay: float | None = None
82) -> None:
83 """
84 Tap at the specified coordinates.
85
86 Args:
87 x: X coordinate.
88 y: Y coordinate.
89 device_id: Optional HDC device ID.
90 delay: Delay in seconds after tap. If None, uses configured default.
91 """
92 if delay is None:
93 delay = TIMING_CONFIG.device.default_tap_delay
94
95 hdc_prefix = _get_hdc_prefix(device_id)
96
97 # HarmonyOS uses uitest uiInput click
98 _run_hdc_command(
99 hdc_prefix + ["shell", "uitest", "uiInput", "click", str(x), str(y)],
100 capture_output=True
101 )
102 time.sleep(delay)
103
104
105def double_tap(

Callers

nothing calls this directly

Calls 2

_run_hdc_commandFunction · 0.90
_get_hdc_prefixFunction · 0.70

Tested by

no test coverage detected