* Move, then click. Modifiers are press/release bracketed via withModifiers * — same pattern as Cowork. AppKit computes NSEvent.clickCount from timing * + position proximity, so double/triple click work without setting the * CGEvent clickState field. key() inside withModifiers needs t
(
x: number,
y: number,
button: 'left' | 'right' | 'middle',
count: 1 | 2 | 3,
modifiers?: string[],
)
| 536 | * the modifier-less path doesn't. |
| 537 | */ |
| 538 | async click( |
| 539 | x: number, |
| 540 | y: number, |
| 541 | button: 'left' | 'right' | 'middle', |
| 542 | count: 1 | 2 | 3, |
| 543 | modifiers?: string[], |
| 544 | ): Promise<void> { |
| 545 | const input = requireComputerUseInput() |
| 546 | await moveAndSettle(input, x, y) |
| 547 | if (modifiers && modifiers.length > 0) { |
| 548 | await drainRunLoop(() => |
| 549 | withModifiers(input, modifiers, () => |
| 550 | input.mouseButton(button, 'click', count), |
| 551 | ), |
| 552 | ) |
| 553 | } else { |
| 554 | await input.mouseButton(button, 'click', count) |
| 555 | } |
| 556 | }, |
| 557 | |
| 558 | async mouseDown(): Promise<void> { |
| 559 | await requireComputerUseInput().mouseButton('left', 'press') |
nothing calls this directly
no test coverage detected