Remapping stylus eraser button, and accurately recognizing stylus model

Hi everyone, I’ve used KDE Plasma for a long time now and it’s definitely my favorite DE out there, and big props to all of the devs and contributors! That said, I’ve recently gotten into digital art, and while from what I’ve searched support for active styluses has come a long way, there’s still quite a few quirks.

Namely, remapping the eraser button on the stylus. Many styluses have their first button hardcoded to be an eraser, with no support in KDE to remap this function. As far as I can tell, there was discussion about this a few months back and the ability to turn the eraser button into just another button, freely re-mappable, was merged into `libinput` as an option for stylus devices.

However, from what I can understand (I’m no DE dev), users can’t directly change `libinput` settings and instead rely on the DE to provide whatever options they need, and KDE Plasma doesn’t seem to have this option yet.

Second issue (which I’m actually not sure if it’s an issue or intended behavior?) is that my stylus model (a Dell Active Pen) doesn’t seem to be accurately recognized, and by that I mean that it has pressure sensitivity, tilt detection, etc, it just displays as generic Wacom stylus.

The thing is pretty much a non-issue I think, but I would really appreciate any additional info on the eraser button option, and if there’s any way currently to get that working or plans for that in the near future!

I managed to find a workaround! If anyone else finds themselves in this situation, I used udev-hid-bpf to change the HID events reported by my pen so that the “invert” flag is transposed to the “secondary barrel button” flag.

Here’s the wiki page for the project:
https://libevdev.pages.freedesktop.org/udev-hid-bpf/index.html

If you have a device that is already supported (look through the files in the /src/bpf/stable directory of the repository) you may be able to just install the binary and have your problem solved.

If, like me, you have a device that’s not yet supported, you’ll have to create your own program to solve the issue, which will involve compiling the project yourself and writing a little bit of C. Thankfully, the wiki is very helpful and has a dedicated tutorial page to making your own program. I’ve never compiled Rust or wrote much C ever, but was able to get it done.