module:MouseEvent

Mouse event class

Constructor

new module:MouseEvent(name, target, positionDefinition, eventopt)

MouseEvent constructor

Parameters:
NameTypeAttributesDescription
nameString

Name of the event

targetEventEmitter

Component concerned by the event

positionDefinitionPositionDefinition

Position of the mouse when event trigger

eventUIEvent<optional>

Original HTML event

Extends

Members

(static) buttons

Set of buttons on a pointing device for easy access

Example
scene.on(`${MouseEvent.events.down}.${MouseEvent.buttons.middle}`, () => {
    console.log("User pressed the middle mouse button");
});

(static) events :MouseEvents

Set of events for easy access

Type:
  • MouseEvents

Type Definitions

MouseButtons

Type:
  • Object
Properties
NameTypeDescription
leftString

Left button on a classic right-handed mouse

mainString

Main button

wheelString

The scroll wheel

middleString

Middle button, usually the scroll wheel

rightString

Right button on a classic right-handed mouse

secondaryString

Secondary button

backwardString

Browse backward button

aux1String

First auxiliary button, usually the browse backward button

forwardString

Browse forward button

aux2String

Second auxiliary button, usually the browse forward button

MouseEvents

Type:
  • Object
Properties
NameTypeDescription
downString

Mouse button is pressed

upString

Mouse button is released

clickString

Mouse button is pressed then released without moving

moveString

Mouse is moved

hoverString

Mouse goes hover a component

leaveString

Mouse leave a component

wheelString

Mouse wheel is scrolled in any direction

scrollDownString

Mouse wheel is scrolled down

scrollUpString

Mouse wheel is scrolled up

zoomOutString

Mouse wheel is scrolled down (away from the screen)

zoomInString

Mouse wheel is scrolled up (toward the screen)

grabString

Mouse is clicked on a draggable component

dragString

Mouse is moved while grabbing a component

dropString

Mouse is release after dragging a component

resizeString

Mouse is moved while holding the handle of a resizable component

rotateString

Mouse is rotating a component

doubleClickString

Mouse is clicked twice rapidly