rnote
rnote copied to clipboard
Shortcut mode for holding a button (like Xournal++)
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 :)
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
PenProgressand 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 :)
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
I think the two suggested improvement would need to be implemented, most users would expect it to work like that.
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 :smile: