pointerId
Summary
A unique identifier for the pointer causing the event
Property of dom/PointerEventdom/PointerEvent
Syntax
Note: This property is read-only.
var result = event.pointerId;
Return Value
Returns an object of type unsigned longunsigned long
The unique identifier of the contact for a touch, mouse or pen.
Examples
// Adds a pointer to the MSGesture object for the red square
function redListener(evt)
{
if (evt.type == "pointerdown")
{
redGesture.addPointer(evt.pointerId);
return;
}
printEvent(evt);
}
Usage
This identifier must be unique from all other active pointers at the time. A user agent may recycle previously retired values for pointerId from previous active pointers, if necessary.
If the device producing the event is a mouse, then the pointerId must be 1. Device types other than mouse must not have a pointerId of 1.
Attributions
Microsoft Developer Network: [pointerId Property Article]