I'm attempting to use Pointer Events to detect graphics tablet input including pen pressure, but Chrome and Firefox don't seem to be reading the tablet device (Wacom Intuos 4) properly. All pointer events come back with the same pointerId and pointerType as my mouse, with the default pressure reading of 0.5. The code I'm using looks something like this:
container.addEventListener("pointerdown", (event) => {
console.log(event.pointerId);
console.log(event.pointerType);
console.log(event.pressure);
}, true);
This outputs "1", "mouse", and "0.5". This occurs for the "pointerdown", "pointermove", and "pointerup" events.
I've tried this on both Windows and Linux with the appropriate drivers installed, and other applications detect pen pressure (Krita, for instance).
Do Chrome and Firefox not support graphics tablets properly yet, or am I simply doing something wrong?
To answer your question:
Do Chrome and Firefox not support graphics tablets properly yet, or am I simply doing something wrong?
No, you're not doing anything wrong.
Most modern browsers support Pointer Events. I have found that (like everything else browser based) the degree of "support" can vary.
This begs the quesiton, "how do we avoid the browser incompatibility nonsense?" For this particular case, I'd recommend Pressure.js.
To see it in action (and test it with your device of choice), check out the Pressure.js examples.