PointerEvent

< dom
Jump to: navigation, search

PointerEvent

This page has been flagged with the following issues:

High-level issues:

Content:


W3C Working Draft

Summary

Provides contextual information associated with input events (for example, from mouse, touch or pen).

Inherits from MouseEvent

Properties

API Name Summary
height The height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer.
isPrimary Indicates if the pointer represents the primary pointer.
pointerId A unique identifier for the pointer causing the event
pointerType Indicates the device type that caused the event (mouse, pen, touch, etc.).
pressure 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.
tiltX The plane angle (in degrees, in the range of [-90,90]) between the Y-Z plane and the plane containing both the transducer (e.g. pen stylus) axis and the Y axis.
tiltY The plane angle (in degrees, in the range of [-90,90]) between the X-Z plane and the plane containing both the transducer (e.g. pen stylus) axis and the X axis.
width The width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer.


Methods

API Name Summary
initPointerEvent Initializes a new PointerEvent created by the createEvent method.


Events

API Name Summary
gotpointercapture Dispatched prior to the dispatch of the first event after pointer capture is set for a pointer. See the PointerEvent object.
lostpointercapture Dispatched after pointer capture is released for a pointer.
pointercancel Dispatched when either (1) the user agent has determined that a pointer is unlikely to continue to produce events (e.g., due to a hardware event), or (2) after having fired the pointerdown event, the pointer is subsequently used to manipulate the page viewport (e.g., 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 off of the hit test boundaries of an element and all of its descendants, including as a result of a pointerup event from a device that does not support hover.
pointermove Dispatched when a pointer changes coordinates, button state, pressure, tilt, or contact geometry (e.g. width and height).
pointerout Dispatched when any of the following occurs:
  • A pointing device is moved out of the hit test boundaries of an element
  • After firing the pointerup event for a device that does not support hover
  • After firing the pointercancel event
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.


Inherited from MouseEvent

Properties

API Name Summary
button Gets the mouse button that caused an event.
buttons Gets a value that indicates which mouse buttons a user pressed.
clientX Gets the x-coordinate of the mouse pointer, relative to the upper-left corner of the viewport (that is, the user agent's client area).
clientY Gets the y-coordinate of the mouse pointer, relative to the upper-left corner of the viewport (that is, the user agent's client area).
layerX
layerY
relatedTarget Gets the secondary element that is involved in an event.
screenX Gets the x-coordinate of the mouse pointer, relative to the upper-left corner of the screen.
screenY Gets the y-coordinate of the mouse pointer, relative to the upper-left corner of the screen.
x Gets the x-coordinate of the mouse cursor, relative to the last positioned ancestor element.
y Gets the y-coordinate of the mouse pointer, relative to the last positioned ancestor element.

Methods

API Name Summary
initMouseEvent Initializes a new mouse event that the createEvent method created.

Events

API Name Summary
click A mouse click event.
dblclick A mouse double click event.
mousedown
mouseenter
mouseleave
mousemove
mouseout
mouseover
mouseup

Needs Examples: This section should include examples.



Related specifications

Specification Status Related Changes
Pointer Events Working Draft Section 3.1

Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic Support ?
?
?
IE10 -ms
?
?

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic support ? ? ? ? ? ? ? ?


Compatibility notes

Browser Version Note
Internet Explorer 10 Pointer events are supported in IE10 with the following prefixes and casings:* MSPointerEvent* MSGotPointerCapture* MSLostPointerCapture* MSPointerCancel* MSPointerDown* MSPointerHover* MSPointerMove* MSPointerOut* MSPointerOver* MSPointerUp

See also

Related articles

Pointer Events







  • PointerEvent