Skip to content

translateMouseEvent

translateMouseEvent(ev, type, metrics, bounds?): MouseEvent

Defined in: src/driver/web/dom.ts:95

Map a DOM mouse event (pixel coordinates relative to the host element) to a ztui MouseEvent in cell units. bounds, when given (the driver’s current column/row count), clamps the result to a valid cell — a host element with padding/border wider than an exact multiple of the cell size would otherwise report coordinates past the last visible column/row that widgets don’t expect.

number

number

number

number

"press" | "release" | "drag" | "move" | "scroll_up" | "scroll_down"

CellMetrics

number

number

MouseEvent