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

Shortcut mode for holding a button (like Xournal++) #728

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

TecCheck
Copy link
Contributor

I recently discovered rnote and I really like it. However I need to have a pen mode like the one in Xournal++ where you hold the shortcut button to activate the tool and once you release it, it goes back to the previous tool.

I don't have much experience with rust so any feedback on code quality is very welcome. Also I'm not quite sure if the name "Hold" is good or not so input is welcome there too.

Otherwise I hope you like it :)

@TecCheck TecCheck changed the title Add shortcut mode for holding a button (like Xournal++) Shortcut mode for holding a button (like Xournal++) Jun 27, 2023
@flxzt
Copy link
Owner

flxzt commented Jun 30, 2023

The code itself looks very good. However the implemented feature doesn't work as one would expect for all tools. I see two possible improvements:

  • when the stylus is lifted and moved away from the drawing tablet, it seems that an "button released" event is emitted and the pen always switches back to the original one. So the user would need to keep the pen in proximity. We should detect this event and ignore it (if it doesn't break anything else) or fix this in some other way.
  • In the current implementation one has to hold the button constantly, regardless of the state of the action that was performed while using the switched tool. For example, when using the selector I would expect that it switches permanently after the user has selected something. To be able to detect this we need to add a new state to PenProgress and refactor the selector to emit it while being in the selected state. We should probably do the same for the shaper/shape builders that have a multi-step build process.

Regarding the naming: "Hold" sounds fine to me :)

@TecCheck
Copy link
Contributor Author

Regarding the first point I personally feel like this is OK as the button is pressed again when the pen comes into proximity again.

For the second point I'd say the Temporary mode already covers this behavior so having it in the hold mode would be kind of redundant. However I don't think it's that hard to implement and if you want to have it I'll look into implementing it

@flxzt
Copy link
Owner

flxzt commented Jul 10, 2023

I think the two suggested improvement would need to be implemented, most users would expect it to work like that.

@TecCheck
Copy link
Contributor Author

Ok then. I guess it will take some time for me to implement this as I haven't done all that much with rust. But I'll try 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants