winit
winit copied to clipboard
Pen tablet support on X11
- [x] Tested on all platforms changed
- [ ] Compilation warnings were addressed
- [ ]
cargo fmthas been run on this branch - [ ]
cargo docbuilds successfully - [ ] Added an entry to
CHANGELOG.mdif knowledge of this change could be valuable to users - [ ] Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
- [ ] Created or updated an example program if it would help users understand this functionality
- [ ] Updated feature matrix, if new features were added or implemented
This is based on @DorianRudolph's work for adding pen tablet support on Linux on X11. The only thing I changed was to have it send Touch events in a similar manner to how pen tablet input is handled on Windows. There are quite a few things to address before accepting this PR, but I'd like to get feedback on whether such a change would be accepted before cleaning it up.
I need tablet / stylus support in a project and I am really interested to get this PR some love. So, what is the state of this PR? Are the winit people interested in merging support for tablets in X11? What needs to be done to get this PR forward?
I'm curious as well what's blocking this merge.
I gave it a shot and it has a few problems.
- It doesn't work. I tried with my Wacom tablet.
- It still needs formatting.
- Probably needs to get updated for the current version of Winit.
If you really need tablet support, I THINK WindowEvent::AxisMotion supports tablets, albeit not in pixel coordinate format. But in tablet space coordinate space.
WindowEvent::AxisMotion might work. I can read the pressure data from there and just rely on the mouse emulation of the X11 Wacom driver to get the actual events like position & button presses.
My main problem going with this approach when I tried it was: How do I know which WindowEvent::AxisMotion is the correct one for my Wacom tablet? There seems to be no way of actually verifying the source of the event (please enlighten me if there is one!), so I'd have to rely on sketchy mappings like "does the event have the correct number of axis".
If you really need tablet support, I THINK WindowEvent::AxisMotion supports tablets, albeit not in pixel coordinate format. But in tablet space coordinate space.
I honestly have no idea what WindowEvent::AxisMotion is intended for, and I'm surprised that you can get tablet input through it.
As for what's blocking this PR in particular (barring any discussion on the proposed API): We don't have an X11 maintainer right now, and no-one else in the @rust-windowing org has stepped up to review and merge this PR.
If you really need tablet support, I THINK WindowEvent::AxisMotion supports tablets, albeit not in pixel coordinate format. But in tablet space coordinate space.
I honestly have no idea what
WindowEvent::AxisMotionis intended for, and I'm surprised that you can get tablet input through it.As for what's blocking this PR in particular (barring any discussion on the proposed API): We don't have an X11 maintainer right now, and no-one else in the @rust-windowing org has stepped up to review and merge this PR.
I think WindowEvent::AxisMotion is used for (but not exclusive to) controller-/joy- sticks.
WindowEvent::AxisMotionmight work. I can read the pressure data from there and just rely on the mouse emulation of the X11 Wacom driver to get the actual events like position & button presses. My main problem going with this approach when I tried it was: How do I know whichWindowEvent::AxisMotionis the correct one for my Wacom tablet? There seems to be no way of actually verifying the source of the event (please enlighten me if there is one!), so I'd have to rely on sketchy mappings like "does the event have the correct number of axis".
Winit can differentiate between device id just fine. How to to actually use DeviceId I find confusing as well. You can't construct deviceId since it's platform dependent and platform_impl is private. It's also unclear to me how it traces back to the platform specific implementation to which may help in deducing what physical device DeviceId refers to. But I digress.
Fyi in https://github.com/maroider/winit/pull/6 I've added a platform extension that allows the XInput id to be retrieved from DeviceId.