As devices with advanced pen input capabilities are becoming increasingly prevalent, it is important that the web platform continues to evolve to fully support these advanced features in order to unlock rich experiences for both end users and developers. One such advancement is the ability for a device's digitizer to recognize more than one pen device interacting with it simultaneously. This feature is an extension to the PointerEvent interface to include a new attribute, persistentDeviceId, that represents a session-persistent, document isolated, unique identifier that a developer can reliably use to identify individual pens interacting with the page.
Currently, developers have no way to distinguish between two individual pens on an ink-enabled digitizer. The existing PointerEvent.id attribute is implemented in different ways and does not always persist for each ink stroke or interaction with the screen. Developers can use this change to have a secure and reliable way to identify individual pen (pointers) interacting with the screen in order to set specific colors or pen shapes for each device interacting with the digitizer.
Explainers: https://github.com/WICG/pointer-event-extensions/blob/main/pointer-event-device-id-explainer.md