(x: number, y: number, durationMs = 800)
| 118 | } |
| 119 | |
| 120 | export 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 | |
| 141 | export async function focusLinux(x: number, y: number): Promise<void> { |
| 142 | await pressLinux(x, y); |
no test coverage detected