I am trying to build a tool (JavaScript website or software with Electron or Tauri) that acts like a drawing app. It should be able to differentiate between stylus (digital pen) input, touch input and mouse inputs. I also would need to detect the stylus buttons, if they are pressed while the stylus touches the screen.
I know there is pointerType
which should be able to tell me if it is pen
, touch
. or mouse
, however, it just does not work reliably. Even though support should be guaranteed (compatibility here), depending on OS and browser, compatibility varies, but most of the time, it does not work (i.e. it can’t differentiate pen and mouse, or it cannot detect the button pressed, …)
Is there any other way I can get this information? Maybe something native to Electron or Tauri…