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

Function longPressLinux

src/platforms/linux/input-actions.ts:120–139  ·  view source on GitHub ↗
(x: number, y: number, durationMs = 800)

Source from the content-addressed store, hash-verified

118}
119
120export async function longPressLinux(x: number, y: number, durationMs = 800): Promise<void> {
121 const provider = resolveLinuxInputProvider();
122 if (provider) {
123 await provider.longPress(x, y, durationMs);
124 return;
125 }
126
127 const { tool } = await ensureInputTool();
128 await moveTo(x, y);
129 if (tool === 'xdotool') {
130 await xdotool('mousedown', '1');
131 await sleep(durationMs);
132 await xdotool('mouseup', '1');
133 } else {
134 // ydotool v1: use click --down / --up for press-hold
135 await ydotool('click', '--down', '0xC0');
136 await sleep(durationMs);
137 await ydotool('click', '--up', '0xC0');
138 }
139}
140
141export async function focusLinux(x: number, y: number): Promise<void> {
142 await pressLinux(x, y);

Callers 1

createLinuxInteractorFunction · 0.90

Calls 7

ensureInputToolFunction · 0.90
sleepFunction · 0.90
moveToFunction · 0.85
xdotoolFunction · 0.85
ydotoolFunction · 0.85
longPressMethod · 0.80

Tested by

no test coverage detected