Constructor
new module:MouseEvent(name, target, positionDefinition, eventopt)
MouseEvent constructor
Name | Type | Attributes | Description |
---|---|---|---|
name | String | Name of the event | |
target | EventEmitter | Component concerned by the event | |
positionDefinition | PositionDefinition | Position of the mouse when event trigger | |
event | UIEvent | <optional> | Original HTML event |
Extends
Members
(static) buttons
Set of buttons on a pointing device for easy access
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
- MouseEvents
Type Definitions
MouseButtons
- Object
Name | Type | Description |
---|---|---|
left | String | Left button on a classic right-handed mouse |
main | String | Main button |
wheel | String | The scroll wheel |
middle | String | Middle button, usually the scroll wheel |
right | String | Right button on a classic right-handed mouse |
secondary | String | Secondary button |
backward | String | Browse backward button |
aux1 | String | First auxiliary button, usually the browse backward button |
forward | String | Browse forward button |
aux2 | String | Second auxiliary button, usually the browse forward button |
MouseEvents
- Object
Name | Type | Description |
---|---|---|
down | String | Mouse button is pressed |
up | String | Mouse button is released |
click | String | Mouse button is pressed then released without moving |
move | String | Mouse is moved |
hover | String | Mouse goes hover a component |
leave | String | Mouse leave a component |
wheel | String | Mouse wheel is scrolled in any direction |
scrollDown | String | Mouse wheel is scrolled down |
scrollUp | String | Mouse wheel is scrolled up |
zoomOut | String | Mouse wheel is scrolled down (away from the screen) |
zoomIn | String | Mouse wheel is scrolled up (toward the screen) |
grab | String | Mouse is clicked on a draggable component |
drag | String | Mouse is moved while grabbing a component |
drop | String | Mouse is release after dragging a component |
resize | String | Mouse is moved while holding the handle of a resizable component |
rotate | String | Mouse is rotating a component |
doubleClick | String | Mouse is clicked twice rapidly |