MCPcopy Create free account
hub / github.com/HELPMEEADICE/doge-code / drag

Function drag

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

696 * needs a HID-tap round-trip to show up there.
697 */
698 async drag(
699 from: { x: number; y: number } | undefined,
700 to: { x: number; y: number },
701 ): Promise<void> {
702 const input = getInput()
703 if (from !== undefined) {
704 await moveAndSettle(input, from.x, from.y)
705 }
706 await input.mouseButton('left', 'press')
707 await sleep(MOVE_SETTLE_MS)
708 try {
709 await animatedMove(input, to.x, to.y, getMouseAnimationEnabled())
710 } finally {
711 await input.mouseButton('left', 'release')
712 }
713 },
714
715 /**
716 * Move first, then scroll each axis. Vertical-first — it's the common

Callers

nothing calls this directly

Calls 5

getInputFunction · 0.85
moveAndSettleFunction · 0.85
animatedMoveFunction · 0.85
mouseButtonMethod · 0.80
sleepFunction · 0.50

Tested by

no test coverage detected