personalizedrefrigerator / js-draw

Draw pictures using a pen, touchscreen, or mouse! JS-draw is a freehand drawing library for JavaScript and TypeScript.
https://personalizedrefrigerator.github.io/js-draw/typedoc/
MIT License
79 stars 8 forks source link

Bug: Assign the eraser to a pen button #75

Open schmoelder opened 2 months ago

schmoelder commented 2 months ago

Describe the issue

Following up the discussion on the Forum, here the bug report / feature request

Steps to reproduce the issue

  1. Open a freehand drawing
  2. Use the Pen buttons

Expected behavior

I would like to assign the pen buttons to do something useful, e.g. the eraser function

Observed behavior

Nothing happens when pressing any of the buttons.

Version information

2.11.0

Platform

Joplin Desktop v3.0.9

Logs

input.log

Additional information

Currently using the Lenovo precision pen 2

personalizedrefrigerator commented 2 months ago

Thank you for the input log!

Based on that, the app is receiving pen events with type mouse and buttons = 1, which is specified to be one of the following:

Left Mouse, Touch contact, Pen contact

If this is on Linux, I see that a similar upstream Chromium bug exists (Joplin uses Electron, which is based on Chromium) (links to this StackOverflow post and this GH issue comment).

Possible workaround:

[^1]: Start Joplin with --enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland