JavaScripture
Contribute via GitHub Feedback

JavaScript PointerEvent : MouseEvent

PointerEvents are a superset of MouseEvents and TouchEvents and also support pen/stylus input.

Constructors

new PointerEvent(type : String, [eventInit : Object]) : PointerEvent
eventInit : {
heightNumber
isPrimaryBoolean
pointerIdNumber
pointerTypeString
pressureNumber
tiltXNumber
tiltYNumber
widthNumber
}

Creates a new PointerEvent of the specified type and initial properties. type must be one of 'pointerover', 'pointerenter', 'pointerdown', 'pointermove', 'pointerup', 'pointercancel', 'pointerout', 'pointerleave', 'gotpointercapture', 'lostpointercapture'.

Instance Properties

height : Number  

The height in CSS pixels of the pointer. May be 0.

isPrimary : Boolean  

True if this pointer was the first pointer to begin contact for the current set of active pointers.

pointerId : Number  

A unique (among active pointers) identifier for the current pointer.

pointerType : String  

The type of pointer. Will be one of 'mouse', 'pen', or 'touch'.

pressure : Number  

A value 0 to 1 indicating how much pressure the user applied. If the pointer device does not report pressure (such as a mouse), the value will be 0.5.

tiltX : Number  

Angle in degrees (-90 to 90) of the pointer (stylus) away from the perpendicular to the surface in the X direction. This is the tilt around the Y axis. -90 means the pointer is laying flat on the surface and pointing to the right. 90 means the pointer is laying flat on the surface and pointing to the left. 0 means the pointer is perpendicular to the surface.

tiltY : Number  

Angle in degrees (-90 to 90) of the pointer (stylus) away from the perpendicular to the surface in the Y direction. This is the tilt around the X axis. -90 means the pointer is laying flat on the surface and pointing to the top. 90 means the pointer is laying flat on the surface and pointing to the bottom. 0 means the pointer is perpendicular to the surface.

width : Number  

The width in CSS pixels of the pointer. May be 0.