Added basic Pen support for X11 #19910
Open
+170
−103
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does the pull request do?
This PR adds support for
PressureTwistXandTwistYfor X11 platform inside Move, Press and Release events.What is the current behavior?
Avalonia on Linux never reports Pen as pointer type and does not set
PressureandTwistproperties in mentioned pointer events.How was the solution implemented (if it's not obvious)?
Pressure and Twist events are simple atomics, I only added a few fields and read from evaluators. Pointer Type is determined based on presence of these evaluators.
I couldn't find information about Twist anywhere, my tablet (Huion H950P) doesn't seem to report it, or at least not without any additional drivers (no evaluator with relevant data is present).
While this PR does not provide full API (back eraser detection, twist), it's already better than having nothing on Linux. I'd be more than happy to implement missing elements.
Twist: I'd need an information about Twist evaluator name and value range provided by their tablet.
Back Eraser: I'd need a small hint where should I implement it, it's not part of RawPointerEvent, but processed PointerEventProperties, not sure where it is handled. I can then try implementing detection based on device name as mentioned in [X11] Some WACOM tablets are not supported #18873. My hardware doesn't support it, but the principle is simple enough to implement dry, then someone could confirm if it works properly.
Barrel buttons: Also, I'd use a hint where it is implemented too.
Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues
#18873