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

Function double_tap

phone_agent/hdc/device.py:105–127  ·  view source on GitHub ↗

Double tap at the specified coordinates. Args: x: X coordinate. y: Y coordinate. device_id: Optional HDC device ID. delay: Delay in seconds after double 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

103
104
105def double_tap(
106 x: int, y: int, device_id: str | None = None, delay: float | None = None
107) -> None:
108 """
109 Double tap at the specified coordinates.
110
111 Args:
112 x: X coordinate.
113 y: Y coordinate.
114 device_id: Optional HDC device ID.
115 delay: Delay in seconds after double tap. If None, uses configured default.
116 """
117 if delay is None:
118 delay = TIMING_CONFIG.device.default_double_tap_delay
119
120 hdc_prefix = _get_hdc_prefix(device_id)
121
122 # HarmonyOS uses uitest uiInput doubleClick
123 _run_hdc_command(
124 hdc_prefix + ["shell", "uitest", "uiInput", "doubleClick", str(x), str(y)],
125 capture_output=True
126 )
127 time.sleep(delay)
128
129
130def long_press(

Callers

nothing calls this directly

Calls 2

_run_hdc_commandFunction · 0.90
_get_hdc_prefixFunction · 0.70

Tested by

no test coverage detected