Home

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

(true
if
this
is
the
primary
contact
for
the
pointer),
width
and
height
(contact
area),
pressure
(0..1),
tiltX
and
tiltY
(stylus
tilt),
and
tangentialPressure.
These
fields
enable
richer
interpretation
of
user
input
and
can
be
used
to
adapt
interactions
to
the
input
method.
coalesced
PointerEvent
objects
that
occurred
between
frames)
and
getPredictedEvents()
(returns
predicted
upcoming
events
to
smooth
rendering
on
high-latency
devices).
all
subsequent
events
for
that
contact
until
releasePointerCapture(pointerId).
This
helps
maintain
consistent
interaction
even
if
the
pointer
moves
outside
the
initial
element.
Events
originated
from
MSPointer
events
and
were
standardized
to
provide
a
single
model
for
mouse,
touch,
and
pen
input,
widely
supported
in
modern
browsers.
They
are
recommended
for
interactive
web
applications
requiring
multi-device
input.