-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
[3.x, macOS, Windows, X11] Add stylus inverted/eraser support to InputEventMouseMotion event #62723
Conversation
…tEventMouseMotion event
74aa008
to
193d5c1
Compare
I tested it again on Windows 11 and Manjaro (Gnome Desktop) with a Wacom Intuos Pro M. Works great! @akien-mga any chance of this getting into 3.5? |
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.
Since it's only adding a new pen_inverted
property to the motion events, it's probably safe for 3.5.
There are a couple changes to Xi code for X11 that make me a bit wary of merging so close to stable. Otherwise yeah it looks fairly low risk. |
@bruvzg @akien-mga Thanks for the review. I will try to describe the XI changes to help clarify your concerns. 1. Changing XIMasterPointer to XISlavePointer in OS_X11::refresh_device_info():This change allows us to query device id and name of every pointer device under the master pointer. For reference, let's look at this output of
Querying XISlavePointer gives access to the raw device names and device ids under the master pointer, whereas querying XIMasterPointer device information means that we would only obtain the name 2. Changing deviceid to sourceid in OS_X11::process_xevents:This change fetches slave pointer's device id instead of master pointer's device id. This makes it possible to correctly retrieve the pen_inverted property from the pen_inverted_devices map. Below, I compare debug outputs with a simple print patch to show why using sourceid is important. Debug print patch:
Debug output sample with XIMasterPointer:
Debug output sample with XISlavePointer:
Raw events all have deviceid 2, which does not contextually give us the right information to determine which device is actually being used. By using sourceid to get device id, we can correctly get the right property information from pen_inverted_devices/pen_pressure_range/pen_tilt_*_range maps. (What would and should happen to the property maps if we plug in two tablets with differing pressure ranges in the current code base? I can't test since I don't own another tablet.) Anyhow, if you believe this should be its own PR/commit, then let me know. |
Thanks for the detailed explanation! Let's give it a spin and see how it fares in 3.5 RC7. |
Thanks! |
Backport of #62212 for 3.x branch.
godotengine/godot-proposals#4702
Simple demo project for 3.x: https://github.com/hansemro/InvertedPenGodotTest/tree/main