Skip to content

DragMouseParams

Parameters for Lib.dragMouse.

Import:

import type { DragMouseParams } from 'obsidian-integration-testing';

Signature:

export interface DragMouseParams

Properties

PropertyTypeDescription
button?MouseButtonThe mouse button to hold for the whole drag.
fromMousePointThe point (web-contents DIP) where the button goes down.
modifiers?readonly Modifier[]The modifier keys to hold for the whole drag, using Obsidian's Modifier names. 'Mod' resolves per-platform (Cmd on macOS, Ctrl elsewhere).
steps?numberHow many held-button moves to send between DragMouseParams.from and DragMouseParams.to, evenly spaced along the straight line, the last one landing on to. More steps make a slower, smoother drag; a handler that tracks the pointer's path (a canvas edge, a drag threshold) needs more than one.
toMousePointThe point (web-contents DIP) where the button is released.
window?WindowThe Obsidian window to drag in: the main window or a popout. Both points are in the named window's viewport.

Links to this page: