MCPcopy
hub / github.com/codeaashu/claude-code / click

Function click

src/utils/computerUse/executor.ts:538–556  ·  view source on GitHub ↗

* 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[],
    )

Source from the content-addressed store, hash-verified

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')

Callers

nothing calls this directly

Calls 4

requireComputerUseInputFunction · 0.85
moveAndSettleFunction · 0.85
drainRunLoopFunction · 0.85
withModifiersFunction · 0.85

Tested by

no test coverage detected