Lib.moveMouse
Lib › moveMouse
Type: (this: void, params: MoveMouseParams) => Promise<void>
Moves the mouse pointer to the given web-contents coordinates using a **trusted** Electron pointer move.A trusted move (injected via Electron's
webContents.sendInputEvent) updates the real pointer state in the CSS engine, so :hover rules genuinely apply — unlike dispatchEvent(new MouseEvent('mouseover')), which is untrusted and never sets :hover. It targets the single shared window's **global** pointer, so only one element is hovered at a time.This is the low-level primitive: it performs a single move and does **not** wait for any state to settle (callers poll their own readiness signal). Prefer Lib.hoverElement / Lib.unhoverElement for element-relative moves; use
moveMouse directly when an element-relative target does not fit (e.g. an element spanning the full viewport width).**Desktop only — it throws on mobile**, for the same reason as Lib.hoverElement: there is no touch pointer to move.
It moves the pointer in the main window unless MoveMouseParams.window names a popout.
**Must be awaited** — see Lib.clickElement.