Open mfauvain opened 5 years ago
I've done some investigating into this, I'm not sure if it's an issue with the Surface Pen hardware or the kernel driver, but I've filed an issue report with libinput either way.
It is not a hardware or software bug, it is a deliberate change made by libinput to fix some other bug (with differently behaving hardware as far as I know).
Previous discussion on the libinput repository:
The actual change:
I think the only thing the kernel could do about it would be to split the pen and eraser events and actually emulate seperate devices for them. But I don't actually know if that is possible.
I think I found a solution to the problem. It is a bandaid fix, but for the moment it works: https://github.com/StollD/split-stylus
Since libinput discards any secondary tools it can find on a single hardware device, this daemon takes control over the events send by the stylus device, and forwards them into two virtual devices: one for the pen and one for the eraser. The events from the original source are then blocked so libinput can only read the virtual devices.
Note: Please don't report this as a "fix" on the libinput repository (or if you do so, do it with the biggest disclaimers). They surely had a good reason for adding that check, no need to make their lives harder.
The lastest libinput version 1.14.901
closed the opened issue. But I haven't had time to test it yet.
Running linux (Arch) on both Surface Pro 6 and Surface Go, works very well with all the patches, thx vmuch. Just a note, when upgrading libinput to 1.14 (from 1.13) pen eraser (top of pen) is not recognized anymore (for example in MyPaint or Xournalpp). Downgrading to 1.13 version restore functionality.