With Xorg, I have a config file that allows me to click one particular button on my trackball mouse to switch the ball so it scrolls within a window (very useful in GIMP) rather than moving the pointer, viz:
Under Wayland this doesn’t work (not surprisingly), so instead I need a file in /etc/udev/hwdb.d. I’ve successfully remapped one of the buttons to act as a middle button so I can use it to paste:
KEYBOARD_KEY_90005=btn_middle
which proves I’m on the right lines. But I seem to be unable to work out (or find from a search) the right keyword to enable another button to be the scroll button. I’ve tried various ideas, such as
libinput list-devices tells me that my mouse has “button” set as scroll method, which seems right (though I’ve tried setting it in my udev file)
I’ve identified the right button using evtest in the same way I identified the one I want to emulate middle, so I’m confident I’m doing that bit right. Does anyone know the right keyword for this?
I think KEYBOARD_KEY_90004=btn_middle is already the default for paste (at least in Plasma), and KEYBOARD_KEY_90005=btn_extra seems to be left available for other uses.
While that might suggest I know what I’m typing about, I actually don’t; as it was something I gleaned from a quick Internet search, a few minutes ago.
Nonetheless, maybe it’s as simple as:
KEYBOARD_KEY_90004=btn_scroll
or something similar; have you tried btn_scroll?
There might be something useful in this StackExchange link:
It is. However, on my tackball, that’s triggered by pressing on the scrollwheel (risking me scrolling as I try). So it’s better for me to re-map it to one of the two extra buttons.
I have now . Sadly still no-go, but thanks for the suggestion.
Thanks. I’d actually tried input-remapper, but that also requires me to know what keyword to use.
With even more searching I’ve discovered I can do this using qdbus, so I’ve added the solution to this thread.
“event2” is identified as the one for my mouse by running sudo evtest, looking for the name of the mouse then working through the various entries for it to find the right one. Select an option then click the button you want to use (if you’ve selected the wrong input device nothing will happen). The required button (in my case 265) can then be identified from the “code” output to your terminal.
[edit]: OK, so now I find that the button code changes between sessions , which doesn’t make life simple. But fortunately it can be scripted up with sudo evemu-describe /dev/input/event2 | grep BTN_SIDE | awk '{print $4}'
where “event2” is the device I’ve identified as my mouse and “BTN_SIDE” is the name of the button I need to remap. Made simpler in a startup script by adding evemu-describe to the sudoers file.