API Reference

Class List

pc.ElementMouseEvent

Extends: pc.ElementInputEvent

Represents a Mouse event fired on a pc.ElementComponent.

Summary

Properties

altKeyWhether the alt key was pressed
buttonThe mouse button
ctrlKeyWhether the ctrl key was pressed
dxThe amount of horizontal movement of the cursor
dyThe amount of vertical movement of the cursor
metaKeyWhether the meta key was pressed
shiftKeyWhether the shift key was pressed
wheelThe amount of the wheel movement

Inherited

Properties

elementThe ElementComponent that this event was originally raised on.
eventThe MouseEvent or TouchEvent that was originally raised.

Methods

stopPropagationStop propagation of the event to parent pc.ElementComponents.

Details

Constructor

ElementMouseEvent(event, element, camera, x, y, lastX, lastY)

Create an instance of a pc.ElementMouseEvent.

Parameters

eventMouseEventThe MouseEvent that was originally raised.
elementpc.ElementComponentThe ElementComponent that this event was originally raised on.
camerapc.CameraComponentThe CameraComponent that this event was originally raised via.
xNumberThe x coordinate
yNumberThe y coordinate
lastXNumberThe last x coordinate
lastYNumberThe last y coordinate

Properties

BooleanaltKey

Whether the alt key was pressed

Numberbutton

The mouse button

BooleanctrlKey

Whether the ctrl key was pressed

Numberdx

The amount of horizontal movement of the cursor

Numberdy

The amount of vertical movement of the cursor

BooleanmetaKey

Whether the meta key was pressed

BooleanshiftKey

Whether the shift key was pressed

Numberwheel

The amount of the wheel movement

Inherited

Properties

pc.ElementComponentelement

The ElementComponent that this event was originally raised on.

MouseEvent, TouchEventevent

The MouseEvent or TouchEvent that was originally raised.

Methods

stopPropagation()

Stop propagation of the event to parent pc.ElementComponents. This also stops propagation of the event to other event listeners of the original DOM Event.