MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / click

Function click

src/utils/computerUse/executor.ts:603–621  ·  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

601 * the modifier-less path doesn't.
602 */
603 async click(
604 x: number,
605 y: number,
606 button: 'left' | 'right' | 'middle',
607 count: 1 | 2 | 3,
608 modifiers?: string[],
609 ): Promise<void> {
610 const input = requireComputerUseInput()
611 await moveAndSettle(input, x, y)
612 if (modifiers && modifiers.length > 0) {
613 await drainRunLoop(() =>
614 withModifiers(input, modifiers, () =>
615 input.mouseButton(button, 'click', count),
616 ),
617 )
618 } else {
619 await input.mouseButton(button, 'click', count)
620 }
621 },
622
623 async mouseDown(): Promise<void> {
624 await requireComputerUseInput().mouseButton('left', 'press')

Callers

nothing calls this directly

Calls 5

requireComputerUseInputFunction · 0.85
moveAndSettleFunction · 0.85
drainRunLoopFunction · 0.85
withModifiersFunction · 0.85
mouseButtonMethod · 0.65

Tested by

no test coverage detected