Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eraser shortcut #235

Closed
Perangelot opened this issue Dec 14, 2021 · 10 comments
Closed

Eraser shortcut #235

Perangelot opened this issue Dec 14, 2021 · 10 comments

Comments

@Perangelot
Copy link

Is your feature request related to a problem? Please describe.
When drawing with my tablet on the slides, it often happens that I want to erase certain lines. Simply undoing the last command won't do it. I have not found a way to do that and there does not seem to be a key defined for it.

Describe the solution you'd like
Create a shortcut for the erase function which is only called while the key the function is bound to is pressed. This way, I could bind one of my tablet buttons to that key in order to easily erase things.

Describe alternatives you've considered
The best alternative of course would be tablet support, but I think this is not worth the effort.

@Cimbali
Copy link
Owner

Cimbali commented Dec 15, 2021

Good to know the drawing features are getting good use! :)

Currently the eraser shortcut is the 0 key by default I believe. You can change it, however it doesn’t toggle back, so you’d need to press 0 for erasing then a number between 1 and 9 to get back to another preset.

So the 2 options for this feature here are:

  • a button that can be held, and all strokes that are drawn in that time are eraser lines
  • a button that toggles between eraser and last preset

@Perangelot
Copy link
Author

Perangelot commented Dec 15, 2021

Thanks for the fast and friendly reply! I'm afraid 0 does not open the eraser. In the configuration file, I cannot find a shortcut for it (just for undo_scribble). I have installed Pympress on Ubuntu using the command on you suggested.

Edit: Seems like the ubuntu package is awfully outdated. I have just built Pympress from source and now I see the eraser option. I am advocating for the first option (hold and erase). The reasons are two-fold:

  1. Usually, you use the eraser only for 1-3 seconds, so holding down a key is way less effort than pressing it twice in 3 seconds.
  2. The stylus pen of a graphics tablet usually has buttons which you can map to keys aswell, so you could e.g. map a stylus button to 0 and 0 to the eraser. This way, everytime you hold the stylus button, you can erase, and if you release it, you can scribble down annotations again.

I'd love to both show how much I appreciate the project and in what dire need I am of this feature with a donation. Is there any way to do that? I didn't find a link yet.

@Cimbali
Copy link
Owner

Cimbali commented Dec 20, 2021

There are no donations, see #216 for a discussion on that topic. In particular, maintaining pympress is a hobby and I intend to keep it that way − no matter how dire the need for new features is, sorry.
It’s not as bad as it sounds though, new features arrive regularly and anyone can contribute with a PR or a suggestion (as you’re doing). And that’s more in the spirit of how I approach this project.

I already started looking into this. Holding the shortcut is doable, though not in the conventional way for actions. The drawback is that it seems impossible to handle 2 distinct cases (so we should pick one):

  • keys are only modifiers, e.g. <Alt> or <Ctrl> − this seems more natural to me but leaves less choice in the key to use
  • keys are not modifiers, e.g. normal letters, numbers, F-keys, etc. (with possibly modifiers too), e.g. x, <Ctrl>e, F2, etc.

@Perangelot
Copy link
Author

Perangelot commented Dec 21, 2021

Thanks for your answer! I very much understand and appreciate the way you go about things.

I am not quite sure if I have understood you correctly; are things like "CTRL-e" possible if keys are only modifiers, or do you mean by only that "CTRL" is one, but "CTRL-x" is none for any x? I'm specifically asking about "CTRL-e" because the openboard-Eraser is bound to "CTRL-e", but its binding cannot be changed. This way, the eraser would work in both programs with the same button.

One more thing that I suggest changing is this: Everytime you switch to a new slide, the highlight/annotations mode is toggled off again, so you have to activate it for every slide again. I think that the mode should only change if (1) you click on it again or (2) you chose another tool.

@Cimbali
Copy link
Owner

Cimbali commented Dec 21, 2021

CTRL-e would be a normal shortcut. Just CTRL would be a modifier-only.

@Perangelot
Copy link
Author

I understand. Then I would opt for the normal shortcut version, simply because most people who scribble on slides use a graphical pen anyhow (and there you can assign a shortcut to a button). This would also guarantee compatibility with OpenBoard. Those who you a mouse could then bind the eraser to a simple shortcut such as Ctrl-SPC.

@Cimbali
Copy link
Owner

Cimbali commented Dec 22, 2021

So both are implemented, either holding just a modifier (implicitly means modifier + click) or a normal shortcut (so you can set <ctrl>e). You can also choose to stay in highlight mode by unticking the option in the Presentation > Highlight mode menu.

You can test by installing the current master.

@Perangelot since you’re a highlight-tool “power user” you could also look through #68 see if some suggestions sound interesting to you.

@Cimbali Cimbali closed this as completed Dec 22, 2021
@Perangelot
Copy link
Author

Perangelot commented Dec 26, 2021

Thanks for the effort! I have pulled the latest changes and tried it out. Staying in highlight mode works perfectly! I still have not quite wrapped my head around how the eraser works, though: If I have set highlight-use-pen::eraser = <ctrl>e in the configuration file, pressing <ctrl>e selects the eraser - even if you let go of it. I think this is what you just call a "shortcut".

The behavior I am looking for is this: As long as you hold <ctrl>e, the eraser is selected, and as soon as you let go of it, the last highlighting tool you worked with is selected again. Is this behavior possible at the moment? Or is it only possible with modifiers? If so, how can I configure it?

Sorry for the questions, but I have just started using github and do not know python :(

Thanks for suggesting to have a look at #68. Once I find time, I'll definitely read through the suggestions :)

@Cimbali
Copy link
Owner

Cimbali commented Dec 26, 2021

The option you want to modify is highlight-hold-erase (highlight-use-pen::eraser will just select the eraser)

@Cimbali
Copy link
Owner

Cimbali commented Dec 27, 2021

I’ve renamed it highlight-hold-to-erase instead of highlight-hold-erase, which is somewhat more understandable. Please update your config file when you get the newer version @Perangelot.

smbct pushed a commit to smbct/pympress that referenced this issue Aug 4, 2023
smbct pushed a commit to smbct/pympress that referenced this issue Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants