1

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.)

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Protector one
  • 6,926
  • 5
  • 62
  • 86

1 Answers1

0

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));
Protector one
  • 6,926
  • 5
  • 62
  • 86
  • PointerEvents is enabled in Chrome 55 (https://blog.chromium.org/2016/10/chrome-55-beta-input-handling.html https://www.chromestatus.com/feature/4504699138998272), which shipped in December (https://chromereleases.googleblog.com/2016/12/stable-channel-update-for-desktop.html). – Josh Lee Apr 06 '17 at 15:45