MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / drag

Function drag

source code/utils/computerUse/executor.ts:581–596  ·  view source on GitHub ↗

* `from === undefined` → drag from current cursor (training's * left_click_drag with start_coordinate omitted). Inner `finally`: the * button is ALWAYS released even if the move throws — otherwise the * user's left button is stuck-pressed until they physically click. * 50ms sleep

(
      from: { x: number; y: number } | undefined,
      to: { x: number; y: number },
    )

Source from the content-addressed store, hash-verified

579 * needs a HID-tap round-trip to show up there.
580 */
581 async drag(
582 from: { x: number; y: number } | undefined,
583 to: { x: number; y: number },
584 ): Promise<void> {
585 const input = requireComputerUseInput()
586 if (from !== undefined) {
587 await moveAndSettle(input, from.x, from.y)
588 }
589 await input.mouseButton('left', 'press')
590 await sleep(MOVE_SETTLE_MS)
591 try {
592 await animatedMove(input, to.x, to.y, getMouseAnimationEnabled())
593 } finally {
594 await input.mouseButton('left', 'release')
595 }
596 },
597
598 /**
599 * Move first, then scroll each axis. Vertical-first — it's the common

Callers

nothing calls this directly

Calls 4

requireComputerUseInputFunction · 0.85
moveAndSettleFunction · 0.85
sleepFunction · 0.85
animatedMoveFunction · 0.85

Tested by

no test coverage detected