daledesilva / obsidian_ink

Other
417 stars 10 forks source link

Enable hotkeys(e.x. Ctrl+z for Undo Ctrl+Shift+z for Redo E for eraser) #28

Open SamU4716 opened 5 months ago

SamU4716 commented 5 months ago

What's your idea? Maybe it was just that I doesn't know how to set the hotkey for it. But these features are really useful and neccessary for pen tablet users. We would be much faster when the hotkey function is implemented. Why? How would it help you (or others)? As the previous answer, more productivity. Any examples or references you think are worth pointing out? nah Anything else? This plugin really makes my day, I will be happy to see the results:)

daledesilva commented 5 months ago

I'm a little nervous about this functionality.

The ink embeds have undo and redo stacks that are separate to the markdown views undo and redo stacks. This means that if the embed is on screen and you want to undo, you'd press ctrl-Z but won't be guaranteed that you'll be undoing the thing you expect.

For instance, imagine you're writing, but then without thinking about it you tap outside the embed for something (maybe just to scroll), then you press ctrl-z to undo your last writing but you're undoing something else in the markdown instead (perhaps even the addition of the embed entirely).

Or, perhaps while you're writing, your palm erroneously taps outside the embed, now the same issue occurs if you press ctrl-z.

In addition to those potential issues, I'm not confident that keyboard shortcuts are an efficient approach for a handwriting interface in which your hands aren't at your keyboard. If you're writing directly on a screen, then it would be quicker to tap the button that's where your hand is than to move your hand to the keyboard and back.

I would ignore my suspicion and implement it as a perk anyway... IF I didn't see the potential downsides described above, but I don't think the potential trade off is worth it for what I see as a niche use case at the moment (which I'm guessing might be one hand on keyboard and one on pen?)

I would love to know more about your setup to understand more.

All of that being said, I do have plans to make many of these actions faster to do. I just believe keyboard shortcuts aren't the answer.

For instance...

daledesilva commented 5 months ago

Keen to hear yours and anyone else's thoughts.

SamU4716 commented 5 months ago

My setup was a pen tablet and it doesn't have a monitor embed. As a result, I have to look at the monitor and draw on a board. Cause the process couldn't allow me to look my pen, so it will be distracting to move my pen to the button. I used to draw digitally, and most of the drawing program got Ctrl+z for redo. I believe that if people are using obsidian on desktop or pc with the same setup as mine, it will be more convenient and productive when this function is implemented.

And for the problem of detecting the editing environment, I have an idea. Could it be possible to add a pop-out window when editing for the writing section? If it's possible, it can help users to focus on the writing rather than markdown view. Most importantly, it will be more conscious for users to differenciate from the markdown view and the writing view.

this is the video that introduces the setup that digital artist who uses even a tablet with display: https://youtube.com/shorts/cCujH-ecGjw?si=LXKhSKMunS7vTfWm

daledesilva commented 5 months ago

This makes sense. I'll have a think about how best to approach it, but at the very least, I'll implement the undo redo keyboard shortcuts in the full view (pop out).

In the beta, drawing already has a full view that you can "open" to, but I'm unsure if the undo shortcuts work.

Writing will have that view in the future too, but not until I improve the latency.

OB0NE commented 4 months ago

I think use the hotkey "e" to toggle between eraser and pen is convenient, just like in the plugin "excalidraw".

daledesilva commented 4 months ago

Good suggestion. It got me thinking. For changing to eraser, I'm likely to go with holding "shift" or something similar. Because the embeds live within the markdown file, it's easy to be looking at the embed and press e, but actually have your cursor in another part of the markdown file - meaning that e will then be typed in and effecting the document somewhere you don't expect. Hence, Shift will be safer.

OB0NE commented 4 months ago

Good suggestion. It got me thinking. For changing to eraser, I'm likely to go with holding "shift" or something similar. Because the embeds live within the markdown file, it's easy to be looking at the embed and press e, but actually have your cursor in another part of the markdown file - meaning that e will then be typed in and effecting the document somewhere you don't expect. Hence, Shift will be safer.

Well-considered.

fugohan commented 1 month ago

I would like to suggest implementing specific double-tap touch gestures for undo and redo actions on iPads:

This feature would significantly enhance the user experience for iPad users, making the handwriting process more fluid and error-forgiving. I understand that people with a Wacom tablet don't think so, but if you use both like I do, it's handy to be a bit faster on the iPad. Many students would benefit from this feature in the long run.

dvapack commented 4 weeks ago

I have same setup as SamU4716 (laptop + pen tablet). I'm planning to use this plugin to do my uni notes, so something like redo or shortcut for erase/writing will be a game changer

daledesilva commented 4 weeks ago

Absolutely. Thanks for the comment. This is on the roadmap. There's just some underlying infrastructure changes to make to facilitate this.

It will also include other potential gestures like switching to eraser temporarily while holding your finger on the screen.