androidgoogle-chromegalaxywacom

How can I use Samsung Note devices' pen pressure in Chrome?


I've seen various web apps (e.g. Colorillo) that support Wacom tablet pens' pressure data by using Wacom's plugin. Chrome for Android does not support plugins, so how can I use the pen pressure of Samsung Galaxy Note devices in the browser? (Which use Wacom's digitizer technology.)


Solution

  • It's possible to use the pen's pressure value in Chrome, but it (currently) requires that the user has a flag enabled.

    Go to chrome://flags/, and set the "Pointer Events" setting to "Enabled". Restart Chrome when prompted.

    Now, you can use the PointerEvent API to get the pressure of the Samsung Note pen. For example, on a page with a canvas you can use:

    ['pointerdown', 'pointermove'].forEach(event => 
        yourCanvasElement.addEventListener(event, e =>
                console.log(e.pressure)
            , false));