API Reference

Class List

pc.ElementMouseEvent

Extends: pc.ElementInputEvent

Represents a Mouse event fired on a pc.ElementComponent.

Summary

Properties

altKey

Whether the alt key was pressed.

button

The mouse button.

ctrlKey

Whether the ctrl key was pressed.

dx

The amount of horizontal movement of the cursor.

dy

The amount of vertical movement of the cursor.

metaKey

Whether the meta key was pressed.

shiftKey

Whether the shift key was pressed.

wheelDelta

The amount of the wheel movement.

Inherited

Properties

camera

The CameraComponent that this event was originally raised via.

element

The ElementComponent that this event was originally raised on.

event

The MouseEvent or TouchEvent that was originally raised.

Methods

stopPropagation

Stop 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

eventMouseEvent

The MouseEvent that was originally raised.

elementpc.ElementComponent

The ElementComponent that this event was originally raised on.

camerapc.CameraComponent

The CameraComponent that this event was originally raised via.

xnumber

The x coordinate.

ynumber

The y coordinate.

lastXnumber

The last x coordinate.

lastYnumber

The 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.

numberwheelDelta

The amount of the wheel movement.

Inherited

Properties

pc.CameraComponentcamera

The CameraComponent that this event was originally raised via.

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.