PointerEvent object
Provides contextual information associated with input events (for example, from mouse, touch or pen).
For a summary of all changes to the Internet Explorer Pointer Events implementation since Internet Explorer 10, see Pointer Events updates.
![]() |
DOM Information
Inheritance Hierarchy
Members
The PointerEvent object has these types of members:
Events
The PointerEvent object has these events.
| Event | Description |
|---|---|
| gotpointercapture |
Dispatched prior to the dispatch of the first event after pointer capture is set for a pointer. |
| lostpointercapture |
Dispatched after pointer capture is released for a pointer. |
| MSPointerHover |
Event that is triggered when a contact (normally a pen) moves over an element without touching the surface. |
| pointercancel |
Dispatched when either (1) the system has determined that a pointer is unlikely to continue to produce events (for example, due to a hardware event), or (2) after having fired the pointerdown event, the pointer is subsequently used to manipulate the page viewport (for example, panning or zooming). |
| pointerdown |
Dispatched when a pointer enters the state of having a non-zero value for the buttons property. |
| pointerenter |
Dispatched when a pointing device is moved into the hit test boundaries of an element or one of its descendants, including as a result of a pointerdown event from a device that does not support hover. |
| pointerleave |
Dispatched when a pointing device is moved outside of the hit test boundaries of an element or one of its descendants, including as a result of a pointerdown event from a device that does not support hover. |
| pointermove |
Dispatched when a pointer changes coordinates, button state, pressure, tilt, or contact geometry (for example, width and height). |
| pointerout |
Dispatched when any of the following occurs:
|
| pointerover |
Dispatched when a pointing device is moved into the hit test boundaries of an element. Also dispatched prior to a pointerdown event for devices that do not support hover. |
| pointerup |
Dispatched when a pointer leaves the state of having a non-zero value for the buttons property. |
Methods
The PointerEvent object has these methods.
| Method | Description |
|---|---|
| getCurrentPoint |
Retrieves a PointerPoint object that provides basic info on the pointer associated with the event. |
| getIntermediatePoints |
Retrieves a collection of PointerPoint objects that represent the pointer history from the last pointer event up to and including the current pointer event. Each PointerPoint in the collection provides basic info on the pointer associated with the event. |
| initPointerEvent |
Used to create an PointerEvent from JavaScript. |
| releasePointerCapture |
Releases a pointer captured by an element (using the setPointerCapture method). |
| setPointerCapture |
Assigns a specified pointer to an element. This method is used to ensure that an element continues to receive pointer events even if the contact moves off the element. |
Properties
The PointerEvent object has these properties.
| Property | Access type | Description |
|---|---|---|
|
Indicates which pointer device button has changed. | ||
|
Indicates which pointer device buttons are being pressed, expressed as a bitmask. | ||
|
Read-only |
Gets a PointerPoint object that provides basic info on the pointer associated with the event. | |
|
Read-only |
The height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer. | |
|
Read-only |
Returns the time at which the pointer data was reported by the hardware, in microseconds. | |
|
Read-only |
Retrieves a collection of PointerPoint objects that represent the pointer history from the last pointer event up to and including the current pointer event. Each PointerPoint in the collection provides basic info on the pointer associated with the event. | |
|
Read-only |
Returns whether the pointer associated with the event is the primary pointer for the current mouse, touch, or pen interaction. | |
|
Read-only |
The unique identifier of the contact for a touch, mouse or pen. | |
|
Read-only |
Returns whether the source of the event is touch, pen or mouse. | |
|
Read-only |
Returns the normalized pressure of the pointer input in the range of [0,1], where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively. | |
|
Read-only |
Returns the angle between the Y-Z plane and the plane containing the pen axis and the Y axis in the range of -90 to +90. A positive X tilt is to the right. | |
|
Read-only |
Returns the angle between the X-Z and transducer-X planes. A positive Y tilt is toward the user. | |
|
Gets the time, in milliseconds, when an event occurred. | ||
|
Read-only |
The width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer. |
Remarks
Unlike mouse events, pointer events are fired by touch, pen, or mouse contact.
See also
