files/en-us/web/api/pointerevent/index.md
{{ APIRef("Pointer Events") }}
The PointerEvent interface represents the state of a DOM event produced by a pointer such as the geometry of the contact point, the device type that generated the event, the amount of pressure that was applied on the contact surface, etc.
A pointer is a hardware agnostic representation of input devices (such as a mouse, pen or contact point on a touch-enable surface). The pointer can target a specific coordinate (or set of coordinates) on the contact surface such as a screen.
A pointer's hit test is the process a browser uses to determine the target element for a pointer event. Typically, this is determined by considering the pointer's location and also the visual layout of elements in a document on screen media.
{{InheritanceDiagram}}
PointerEvent.This interface inherits properties from {{domxref("MouseEvent")}} and {{domxref("Event")}}.
PointerEvent.0 to 1, where 0 and 1 represent the minimum and maximum pressure the hardware is capable of detecting, respectively.-1 to 1, where 0 is the neutral position of the control.-90 to 90) between the Y–Z plane and the plane containing both the pointer (e.g., pen stylus) axis and the Y axis.-90 to 90) between the X–Z plane and the plane containing both the pointer (e.g., pen stylus) axis and the X axis.0 to 359.PointerEvent instances that were coalesced into the dispatched {{domxref("Element/pointermove_event", "pointermove")}} event.PointerEvent instances that the browser predicts will follow the dispatched {{domxref("Element/pointermove_event", "pointermove")}} event's coalesced events.The PointerEvent interface has several event types. To determine which event fired, look at the event's {{domxref("Event.type", "type")}} property.
[!NOTE] It's important to note that in many cases, both pointer and mouse events get sent (in order to let non-pointer-specific code still interact with the user). If you use pointer events, you should call {{domxref("Event.preventDefault()", "preventDefault()")}} to keep the mouse event from being sent as well.
{{domxref('Element/pointerover_event', 'pointerover')}}
{{domxref('Element/pointerenter_event', 'pointerenter')}}
pointerdown event from a device that does not support hover (see pointerdown). This event type is similar to pointerover, but differs in that it does not bubble.{{domxref('Element/pointerdown_event', 'pointerdown')}}
: The event is fired when a pointer becomes active. For mouse, it is fired when the device transitions from no buttons pressed to at least one button pressed. For touch, it is fired when physical contact is made with the digitizer. For pen, it is fired when the stylus makes physical contact with the digitizer.
[!NOTE] For touchscreen browsers that allow direct manipulation, a
pointerdownevent triggers implicit pointer capture, which causes the target to capture all subsequent pointer events as if they were occurring over the capturing target. Accordingly,pointerover,pointerenter,pointerleave, andpointeroutwill not fire as long as this capture is set. The capture can be released manually by calling {{ domxref('element.releasePointerCapture') }} on the target element, or it will be implicitly released after apointeruporpointercancelevent.
{{domxref('Element/pointermove_event', 'pointermove')}}
{{domxref('Element/pointerrawupdate_event', 'pointerrawupdate')}} {{experimental_inline}}
{{domxref('Element/pointerup_event', 'pointerup')}}
{{domxref('Element/pointercancel_event', 'pointercancel')}}
{{domxref('Element/pointerout_event', 'pointerout')}}
pointerup event for a device that does not support hover (see pointerup); after firing the pointercancel event (see pointercancel); when a pen stylus leaves the hover range detectable by the digitizer.{{domxref('Element/pointerleave_event', 'pointerleave')}}
{{domxref('Element/gotpointercapture_event', 'gotpointercapture')}}
{{domxref('Element/lostpointercapture_event', 'lostpointercapture')}}
Examples of each property, event type, and global event handler are included in their respective reference pages.
{{Specifications}}
{{Compat}}