MouseEvent

Represents a mouse event, inherited from Event, which is a type of event that describes the user's interaction with the mouse. For example, mouse click.

Instance property

button

button: number;

When a mouse event is triggered, if any mouse button is pressed or released, a integer value representing this mouse button will be returned.

ValueDescription
1primary mouse button
2secondary mouse button
3middle mouse button

buttons

buttons: number;

When a mouse event is triggered, if any buttons are pressed, a integer value representing multiple buttons which user is pressing will be returned. Each button occupies one bit field.

BitDescription
0primary mouse button
1secondary mouse button
2middle mouse button

x

x: number;

Represents the horizontal axis position of the mouse pointer in the UI coordinate system that contains the mouse pointer and is closest to the user.

y

y: number;

Represents the vertical axis position of the mouse pointer in the UI coordinate system that contains the mouse pointer and is closest to the user.

pageX

pageX: number;

Indicates the horizontal axis position of the mouse pointer in the current LynxView coordinate system.

pageY

pageY: number;

Represents the vertical axis position of the mouse pointer in the current LynxView coordinate system.

clientX

clientX: number;

Indicates the horizontal axis position of the mouse pointer in the current window coordinate system.

clientY

clientY: number;

Indicates the vertical axis position of the mouse pointer in the current window coordinate system.

Type of MouseEvent

mousedown

Indicates a mouse button is pressed (primary or secondary). target is the UI closest to the user that contains the mouse pointer.

mousemove

Indicates that the mouse moves after mousedown. target is always the same as target of mousedown.

mouseup

Indicates that the mouse button is released, target is the same as mousedown's target.

mouseenter

Indicates that the mouse moves into the activation area of target for the first time. target is the UI that contains the mouse pointer and is closest to the user.

Note: the mouseenter event does not bubble, and it can't be captured by using capture- API.

mouseover

Indicates that the mouse is moving inside target after mouseenter. target is the UI that contains the mouse pointer and is closest to the user.

mouseleave

Indicates that the mouse moves out of the activation area of target for the first time. target is the same as previous mouseenter.

Note: the mouseleave event does not bubble, and it can't be captured by using capture- API.

Compatibility

LCD tables only load in the browser

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.