PointerEvent
PointerEvent is a DOM event interface representing input from pointing devices such as a mouse, pen, or touch. It is part of the Pointer Events API, a W3C standard designed to unify input handling across device types and to provide more detailed data about the contact point. PointerEvent objects are dispatched by the browser in response to pointer events such as pointerdown, pointermove, pointerup, and pointercancel, as well as pointerover, pointerout, pointerenter, and pointerleave.
Core properties include pointerId (a unique identifier for the contact), pointerType ("mouse", "pen", or "touch"), isPrimary
The API also exposes methods for accessing historical data, such as getCoalescedEvents() (returns an array of
Pointer events support advanced features like pointer capture, where an element can call setPointerCapture(pointerId) to receive
Common events include pointerdown, pointermove, pointerup, and pointercancel, along with pointerover, pointerout, pointerenter, and pointerleave. Pointer