Class: MouseEvent

pc.MouseEvent

MouseEvent object that is passed to events 'mousemove', 'mouseup', 'mousedown' and 'mousewheel'.

Constructor

new MouseEvent(mouse, event)

Create an new MouseEvent
Parameters:
Name Type Description
mouse pc.Mouse The Mouse device that is firing this event
event MouseEvent The original browser event that fired
Properties:
Name Type Description
x Number The x co-ordinate of the mouse pointer relative to the element pc.Mouse is attached to
y Number The y co-ordinate of the mouse pointer relative to the element pc.Mouse is attached to
dx Number The change in x co-ordinate since the last mouse event
dy Number The change in y co-ordinate since the last mouse event
button Number The mouse button associated with this event. Can be:
wheel Number A value representing the amount the mouse wheel has moved, only valid for mousemove events
element Element The element that the mouse was fired from
ctrlKey Boolean True if the ctrl key was pressed when this event was fired
shiftKey Boolean True if the shift key was pressed when this event was fired
altKey Boolean True if the alt key was pressed when this event was fired
metaKey Boolean True if the meta key was pressed when this event was fired
event MouseEvent The original browser event
Since:
  • 0.88.0
Source: