Skip to content

Vibe coding a plugin? 😎 Teach your agent Modlumi first. Works with Claude Code, Codex, Cursor and more.

CanvasEvent

What the user did with the mouse on a canvas.

readonly button: number

0 for the left button, 1 for the right and 2 for the middle.


readonly dx: number

A drag’s movement since the previous drag event.


readonly dy: number


readonly item: string | null

The id of the topmost shape the click or drag started on, or null.


readonly type: "doubleClick" | "click" | "drag" | "release"

"click", "doubleClick", "drag" while moving with a button held after pressing on the canvas, and "release" when such a drag ends.


readonly x: number

Mouse position in canvas pixels.


readonly y: number