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

Method _handle_long_press

phone_agent/actions/handler.py:213–222  ·  view source on GitHub ↗

Handle long press action.

(self, action: dict, width: int, height: int)

Source from the content-addressed store, hash-verified

211 return ActionResult(True, False)
212
213 def _handle_long_press(self, action: dict, width: int, height: int) -> ActionResult:
214 """Handle long press action."""
215 element = action.get("element")
216 if not element:
217 return ActionResult(False, False, "No element coordinates")
218
219 x, y = self._convert_relative_to_absolute(element, width, height)
220 device_factory = get_device_factory()
221 device_factory.long_press(x, y, device_id=self.device_id)
222 return ActionResult(True, False)
223
224 def _handle_wait(self, action: dict, width: int, height: int) -> ActionResult:
225 """Handle wait action."""

Callers

nothing calls this directly

Calls 4

get_device_factoryFunction · 0.90
long_pressMethod · 0.80
ActionResultClass · 0.70

Tested by

no test coverage detected