rust-windowing / winit

Window handling library in pure Rust
https://docs.rs/winit/
Apache License 2.0
4.89k stars 914 forks source link

Web: make use of `PointerEvent.persistentDeviceId` #3871

Open daxpedda opened 3 months ago

daxpedda commented 3 months ago

Currently PointerEvent.pointerId is used to build DeviceId, however this isn't perfect because the same device can get a new ID when it is disabled during a session. E.g. your mouse is plugged and the unplugged: it will get a new DeviceId. This is especially bad for non-connected (battery-free) pens, which get a new DeviceId every time they leave the maximum hover distance.

For this reason a new PointerEvent.persistentDeviceId was introduced, which identifies a specific device by a unique device ID throughout the whole session. This is supported by default on Chrome since v128.

W3C Caniuse WPT Firefox Standard Positions WebKit Standard Positions