MCPcopy Index your code
hub / github.com/callstack/agent-device / handleLongPressCommand

Function handleLongPressCommand

src/core/dispatch-interactions.ts:59–69  ·  view source on GitHub ↗
(
  interactor: Interactor,
  positionals: string[],
)

Source from the content-addressed store, hash-verified

57};
58
59export async function handleLongPressCommand(
60 interactor: Interactor,
61 positionals: string[],
62): Promise<Record<string, unknown>> {
63 const { x, y } = readPoint(positionals, 'longpress requires x y [durationMs]', {
64 hint: 'Direct platform longpress requires coordinates. In an open daemon session, use agent-device longpress @ref|selector [durationMs]; otherwise run snapshot -i, use the target rect center as x y, then retry longpress x y durationMs.',
65 });
66 const durationMs = positionals[2] ? Number(positionals[2]) : undefined;
67 await interactor.longPress(x, y, durationMs);
68 return { x, y, durationMs, ...successText(`Long pressed (${x}, ${y})`) };
69}
70
71export async function handleFocusCommand(
72 interactor: Interactor,

Callers 2

dispatch.tsFile · 0.90

Calls 3

successTextFunction · 0.90
longPressMethod · 0.80
readPointFunction · 0.70

Tested by

no test coverage detected