Canvas Toolkit
← Class index

CMouseEvent

Events · extends CEvent

Event describing mouse input at a widget-relative position.

import { CMouseEvent } from "canvas-toolkit-lib";

Declared members

constructor(type: CEventType, x: number, y: number, button: number, shiftKey?: boolean, clickCount?: number, ctrlKey?: boolean);

Creates a mouse event. @param type Mouse event type. @param x X coordinate relative to the receiving widget. @param y Y coordinate relative to the receiving widget. @param button Mouse button associated with the event. @param shiftKey Whether Shift is pressed. @param clickCount Number of consecutive clicks; defaults to one. @param ctrlKey Whether Control is pressed.

x(): number;

Returns the widget-relative X coordinate.

y(): number;

Returns the widget-relative Y coordinate.

pos(): CPoint;

Returns the widget-relative mouse position.

button(): CMouseButton;

Returns the mouse button associated with the event.

clickCount(): number;

Returns the number of consecutive clicks.

modifiers(): number;

Returns the active CKeyboardModifier flags.