-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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 inversion/eraser-end property for tablet pens #62212
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
What's your OS and tablet model? It's possibly a driver/OS bug...on Linux at least the same kind of flakiness exists for pressure sensitivity (jump from 0.5 to 1.0 and back in 1 frame without any kind of pressure change). I had to filter these out in Lorien. I can test it later on Windows and Manjaro with a Wacom Intuos Pro (and regular) |
Approved continuous integration testing actions. |
This comment was marked as outdated.
This comment was marked as outdated.
I will suggest that this be put into core, because this type of filtering is hard to design and it's a common usecase of pens. @JFonS since you are making a pen app, thoughts? |
Fixed the intermittent signal issues in x11 by removing a bad assignment that sets the property to false.
In Windows, only wintab had the intermittent issue and was fixed in 3.x by leveraging pressure & tilt update logic for wintab API.
Will update PR branch soon after testing. Edit: Done |
With fixes, we no longer require complicated state machine to filter bad pen_inverted signals in godot projects. Lorien code from above is so much better now: https://github.com/hansemro/Lorien/blob/77ecb0524bbd3152b9e2fa282efba72d1f125063/lorien/InfiniteCanvas/InfiniteCanvas.gd#L57-L61 |
I tested the latest build on Windows 11 with a Wacom Intuos Pro - no problems, works great now! The Linux (Mono) editor CI build failed however...something related to the class reference Edit: Built it myself on Manjaro Linux - works without problems. I also tried the CI build of the macOS editor on an M1 Mac Mini but it crashed with a |
@mbrlabs CI builds for just x86_64
|
Not sure what to do to fix this. I don't want to make blind attempts to fix this. |
See https://docs.godotengine.org/en/latest/community/contributing/updating_the_class_reference.html to make sure that what you probably added manually actually matches what the doc generator would have done. Here the problem is the alphabetical order not being respected. |
Another macOS issue: once pen_inverted is set true, moving mouse (or any non-tablet interface) does not clear it when it should. Debug print patch
Debug build console log
One fix is to only retain pen_inversion on tablet subevents and default to false on other event subtypes. Edit: Fixed by 367a653 Console log with fix
|
Let me know if want me to rebase or squash commits later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least macOS and Windows changes seems fine, but I do not have any pan with the eraser to actually test it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall. The changes should be squashed before merging, given the scope (+69, -10) I think a single commit is fine for all 3 platform implementations.
InputEventMouseMotion event
Squashed the commits. |
Thanks! And congrats for your first merged Godot contribution 🎉 |
godotengine/godot-proposals#4702
Status: Ready for review
As stated in the proposal, this pull request introduces a new InputEventMouseMotion boolean property called
pen_inverted
which is true when the eraser-end of the pen is detected. This new property makes it possible to map different behavior to both ends of a tablet pen.Currently, this PR supports Windows (wintab & winink), Linux, and macOS.
Simple demo project: https://github.com/hansemro/InvertedPenGodotTest/tree/godot4