2017-01-26 23 views

回答

0

可以在Chrome中使用筆的壓力值,但它(當前)要求用戶啓用標誌。

轉到chrome://flags/,並將「指針事件」設置爲「已啓用」。出現提示時重新啓動Chrome。

現在,您可以使用PointerEvent API來獲得Samsung Note筆的壓力。例如,用帆布一個頁面上,你可以使用:

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

PointerEvents是在Chrome 55啓用(https://blog.chromium.org/2016/10/chrome-55-beta-input-handling。 html https://www.chromestatus.com/feature/4504699138998272),它在十二月發貨(https://chromereleases.googleblog.com/2016/12/stable-channel-update-for-desktop.html)。 –

相關問題