daledesilva / obsidian_ink

Other
417 stars 10 forks source link

Enable tapping on the select/write/erase/... buttons with stylus pens #17

Closed RyotaUshio closed 3 months ago

RyotaUshio commented 5 months ago

Thank you a lot for this wonderful project.

I have a suggestion. Currently, this plugin works as below:

It would be great if it behaves as below instead:

This change will eliminate the need for switching between my pen and finger when I want to use the eraser tool.

daledesilva commented 5 months ago

Thanks for you message and suggestions.

I agree with your description of how it should work, however, on my iPad, that's exactly what it does. (Apart from also allowing finger writing input if you haven't yet used the stylus).

Please let me know your device and operating system, and also type of stylus (Not all styluses are the same).

RyotaUshio commented 5 months ago

Thank you for the reply. My device is an iPad Pro 12.9-inch 4th generation with iPadOS 16.6.1. I use Apple Pencil 2nd generation. I will try updating iPadOS to the latest version.

RyotaUshio commented 5 months ago

Okay, I've figured out I should have put it in a different way. Let me rephrase.

When I put down my Apple Pencil on a button and release it without moving the pen tip, I can successfully press the button. This is great.

https://github.com/daledesilva/obsidian_ink/assets/72342591/3de563a8-e89b-434d-a983-b911942f0fa7

However, if the tip of my pen moves even slightly, then it is recognized as a stroke rather than a tap.

https://github.com/daledesilva/obsidian_ink/assets/72342591/757206b6-b97a-40ce-841b-cf056c83e3a7

This can be not very user-friendly in my opinion. It would be great if you could ignore small enough pen movements on these buttons.

How about listening to touchend/mouseup event rather than click? (the event names might be incorrect but I hope you know what I mean)

daledesilva commented 5 months ago

Thanks. THat's very clear now. I'll see if I can reproduce and fix it.

daledesilva commented 5 months ago

This is now fixed and will be in the new version once live. Thanks for reporting 😊

It's been fixed in 2 ways.

  1. Because the embeds now show the buttons outside of the embed most of the time, it was mostly not an issue, however, scrolling the page down would cause the buttons to move over the embed and also opening the ink file directly should show the buttons over the embed.

  2. The pointerUp still seemed to sometimes not activate the button on pen slip, and it added a new issue where you could slip onto an adjacent button and activate that on up accidently instead. The button's have therefore been changes to onPointDown (Pointer applies to both mouse and touch).

daledesilva commented 4 months ago

You can use this in v0.1.192 now if installing through BRAT.

RyotaUshio commented 4 months ago

Thank you so much for your effort. Unfortunately, this problem is still persisting:

RPReplay_Final1715601297

(Obsidian 1.5.12 on iPad, Ink 0.1.192)

daledesilva commented 4 months ago

Thanks for the video. This looks more like issue #35 to me. Do you have the scribble setting activated on your iPad?