PointerEvent

< dom(Redirected from dom/objects/PointerEvent)
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.
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
offsetX Gets the x-coordinate of the mouse cursor, relative to the target node.
offsetY Gets the y-coordinate of the mouse cursor, relative to the target node.
pageX Gets the x-coordinate of the mouse cursor, relative to the upper-left corner of the page.
pageY Gets the y-coordinate of the mouse cursor, relative to the upper-left corner of the page.
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).
fromElement Non standard. Proprietary. Use relatedTarget instead. Gets the element that the mouse pointer exited, if any.
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.
toElement Non standard. Proprietary. Use target instead. Gets the element that the mouse cursor entered.
which Non standard. Proprietary. Use button or buttons instead. Gets which mouse button is pressed.
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

No events.

Inherited from UIEvent

Properties

API Name Summary
detail Gets additional, developer defined, information about an event.
view Gets the window object that an event is generated from.

Methods

API Name Summary
initUIEvent Initializes a new user interface event that the createEvent method created.

Events

No events.

Inherited from Event

Properties

API Name Summary
bubbles Gets a value that indicates whether an event propagates up from the event target.
cancelBubble Non standard. Proprietary. Use bubbles, stopImmediatePropagation and stopPropagation instead. Gets or sets a value that indicates whether an event should be stopped from propagating up from the current target.
cancelable Gets a value that indicates whether you can cancel an event's default action.
currentTarget Gets the event target that is currently being processed.
defaultPrevented Gets whether the default action should be canceled.
eventPhase Gets the event phase that is being evaluated.
isTrusted Gets a value that indicates whether a trusted event source created an event.
reason Non standard. Proprietary. Gets the state of completion of the data transfer.
returnValue Non standard. Proprietary. Use preventDefault and defaultPrevented instead. Sets or retrieves the return value from the event, which may prevent the default action of the event from happening.
srcElement Non standard. Proprietary. Use target instead. Gets the element that the event was originally dispatched to.
target Gets the element that is the original target of the event.
timeStamp Gets the time, in milliseconds, when an event occurred.
type Gets the name of an event.

Methods

API Name Summary
initEvent Initializes a new generic event that the createEvent method created.
preventDefault Cancels the default action of an event, if possible.
stopImmediatePropagation Prevents any further propagation of an event.
stopPropagation Prevents propagation of an event beyond the current target.

Events

No events.

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:

See also

Related articles

Pointer Events


  • PointerEvent