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
Add undo touch gesture #5133
base: master
Are you sure you want to change the base?
Add undo touch gesture #5133
Conversation
Great feature! Love to see this being implemented. It works well on my side.
|
I really like that idea. I think allowing a movement of a few pixels around the starting point of the tap would be a good way to do this.
I agree, that should be excluded.
unintentional, I'll undo that. |
The gesture now only gets canceled if the distance between the starting point of a tap and the current position exceeds 5 pixels. This applies for each finger separately. Also accidentally tapping the screen while actively scrolling should not trigger the undo. But if you stop scrolling and then tap it should undo. |
This will conflict with #4861 (especially if you want to implement a 3 fingers redo gesture). |
I think I would be able to solve these conflicts if necessary. A redo gesture generally sounds like a good idea to me, but I would rather use something other than a 3 finger tap to avoid conflict with system gestures. But I don't have any ideas for a gesture that would fit intuitively. |
I have used this for some time now and have a few remarks: The up-to-five-pixels-motion is good, but there is a delay between the tap and the actual undo, which can get really annoying. I ended up reverting to the simple version, which is instantaneous. A three-finger tap will also trigger an undo (I know you've implemented an exception for this to be dropped, but it seemingly isn't caught). Pulling with three fingers, to to switch workspaces or other, triggers it as well. I guess the desktop environment takes over three-finger events, so xournal++ will see only a two-finger tap. I wonder how it would be possible to catch this. (I'm on KDE Wayland, maybe it's not consistent between different setups. ) I also have some issues with hand recognition not working quite properly, which did also cause some false positive undos. It's better with the simple (1px) version, but not 100% good either. I guess that's also a situation where xournal++ should probably receive more than 2 inputs and maybe it doesn't. So maybe a fix for the above issue will also solve this. Another workaround could be to set a maximum distance between the two fingers (but it's is not guaranteed to work and I don't really like limitations like this). The touchscreen input code does indeed feel like it needs a good rework... It's probably wise to wait until #4861 is merged before putting too much work into this. |
This PR adds an undo gesture - tapping the touchscreen with two fingers. If motion is detected during the touch it is rejected to not interfere with zooming or scrolling.
I also added a checkbox in the settings' Touchscreen tab to toggle it on or off.
I suggested this feature in #5023