BTN_STYLUS3 not handled
While reviewing and compare various code bases on their stylus button mappings, I noticed that this module does not currently handles BTN_STYLUS3
here: https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/blob/30500626fe598b6199ed0d4a55a20bfdd4566c6b/src/xf86libinput.c#L223
In other codebases, I've seen them define BTN_STYLUS3
manually if not already defined, so I assume this one was added to the kernel input subsystem later than the others.
I believe the usual approach for handling this button is to map it to button 8 (1/2/3 for left/middle/right, then skip 4-7 for scroll wheel buttons, so 8 is the first free one). This is what I think xf86-input-wacom does and others (like Mutter under Wayland, or GTK under Wayland, or XWayland) seem to have adopted the same convention.
Note that the button is implicitly handled by the default case, but because the BTN_STYLUSx
numbers are way up from the regular mouse button numbers, this is not really meaningful (it produces an event for button 8 + BTN_STYLUS3 - BTN_SIDE = 8 + 0x149- 0x113 = 62).