mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-24 09:46:59 -06:00
On Linux under X11, and under XWayland, winit 0.30 hands a drawing tablet's pen to the window as a mouse without its pressure. Every pen stroke reached the tools at full pressure: a Calligraphic brush with Size on Pressure drew one width, and the Liquify tools' Use Pressure Pen applied full intensity. When the window is on X11, the desktop app now reads XInput2 raw events on a second X connection (x11rb's RustConnection, without unsafe). A device with an "Abs Pressure" valuator is a pen, unless its XInput type is TOUCHPAD or TOUCHSCREEN. Its pressure, scaled from the valuator's range to 0..1, goes into Services::stylus, and another pointer moving clears it. The canvas uses that pressure when a frame has no touch force. A press takes the highest pressure of the pen's latest touch since the canvas last read the feed, and waits up to 5 ms for the touch of a hovering pen. The moves and the release of a held press keep the pressure the pen last touched with when its lift has already arrived. Native Wayland is unchanged. The valuator mapping and the reader come from PhotoCraft's tablet crate (storytold/photocraft#255), with the pressure axis only. Docs: README.md, docs/development.md, docs/hardware-parity.md, docs/target-app-parity.md.