Skip to content

@jsvision/core / MouseEvent

Interface: MouseEvent ​

Defined in: input/events.ts:35

A mouse button/motion report. Coordinates are 1-based, exactly as the terminal sends them.

The ctrl/alt/shift flags report the modifiers held during the report, decoded from the SGR button byte — they let a click handler distinguish, e.g., a plain click from a Ctrl+click. They are optional and populated only on decoded events; a hand-built MouseEvent literal that omits them reads as an unmodified press (undefined → falsy). Modifier reporting is best-effort per terminal — some terminals intercept combinations such as Ctrl+click for their own use.

Properties ​

alt? ​

readonly optional alt?: boolean

Defined in: input/events.ts:44

Meta/Alt held during the report.


button ​

readonly button: number

Defined in: input/events.ts:38


ctrl? ​

readonly optional ctrl?: boolean

Defined in: input/events.ts:42

Ctrl held during the report (from the SGR button byte).


kind ​

readonly kind: "drag" | "down" | "up" | "move"

Defined in: input/events.ts:37


shift? ​

readonly optional shift?: boolean

Defined in: input/events.ts:46

Shift held during the report.


type ​

readonly type: "mouse"

Defined in: input/events.ts:36


x ​

readonly x: number

Defined in: input/events.ts:39


y ​

readonly y: number

Defined in: input/events.ts:40