Skip to content

moveMouse

Moves the pointer to the given viewport coordinates using a trusted pointer move, so :hover rules genuinely apply.

The low-level primitive: a single move that does not wait for any state to settle. Prefer hoverElement / unhoverElement for element-relative moves.

Desktop only — it throws on mobile, which has no persistent pointer to move.

Import:

import { moveMouse } from '@mnaoumov/obsidian-lib/trusted-input';

Signature:

function moveMouse(params: MoveMouseParams): Promise<void>

Parameters:

Parameter Type Description
params MoveMouseParams The viewport coordinates to move to.

Returns: Promise<void> — A Promise that resolves once the move has been injected.


Links to this page: