Open personalizedrefrigerator opened 9 months ago
If it is only possible to listen for button events when the pointer is above the screen, it is still perfect for using the eraser. Samsung Notes, for example, activates the eraser while holding the button and switches back to the normal pen when lifting the finger off.
Or was that what you were talking about, that that is not possible?
At least with my tablet, this is what happens when I try to draw with the eraser button down:
buttons: 1
,buttons: 1
This can be seen by checking the "live update" checkbox on the input logging page, pushing the eraser button, then trying to draw.
Additionally, MDN and the PointerEvents spec state that buttons: 32
means that the eraser is pressed (not buttons: 1
).
Notes:
js-draw
does have code that should support erasing with the eraser button on the pen, but, for the reasons mentioned above, it's untested.I tried it. While connected to air actions it definitely registers the button press. Dont know how to test whether it works with the button pressed for a long time. There is no reaction for that
Samsung Internet does seem to send pointer events when drawing with the eraser button pressed. However, these pointer events have buttons: 1
. According to the Pointer Events spec, however, this means "Left Mouse, Touch contact, Pen contact".
Yes i see that. I didnt get any event when eraser buttons is pressed. Strange. It should be 32
FWIW now that this lib is included in Joplin for handwritten notes, this would improve a lot the note-taking experience in Samsung tablets with S-Pen.
the chinese app touchnotes supports erasing with a samsung pen. No other pen events are working, but the pressing and holding event does work, so there is defeinitely a work around for there
Did you try to fix it in May. What should I try?
the chinese app touchnotes supports erasing with a samsung pen. No other pen events are working, but the pressing and holding event does work, so there is defeinitely a work around for there
In Joplin, js-draw
runs within a WebView, which (on most systems) is based on Chromium. From a brief web search, it looks like touchnotes is a native app. Based on this and the upstream bug report, I suspect that the issue is related to Chromium and not the native Android APIs.
Possible next steps:
Currently, the eraser button on physical styluses does nothing.
At present, this is because Chromium seems to not report stylus events when the stylus is down (just when the stylus is above the screen), or a bug in how
js-draw
is registering pointer event listeners.Even if we can only listen for button events when the pointer is above the screen, pressing the button could be used to, for example, switch tools.