I use a 10-button mouse (Logitech M705). Under X11, I was able to configure one of the extra buttons to behave as a second middle-click by modifying files in etc/X11/xorg.conf.d
.
Under Wayland, this no longer works. My research shows that I need to do something with libinput
. I thought this would be a common problem but can't find an answer anywhere.
Can someone explain how to remap mouse buttons or explain why it can't be done?
Best Answer
Remapping buttons if you're running Wayland could be done like this:
Run
xev | grep button
to log mouse click events and get the number of the event by f.e clicking in the window. In my case, middle button is:and I want to map it on:
Then run
xinput --list
and find your pointer device, mine is:xinput get-button-map 9
returns:xinput set-button-map:
NOTE: replace the number
9
for the number returned byid=
And if that key's behavior is defined, your event is mapped. If it is not, that's a little bit different issue. Under Wayland TBH I haven't found a way for executing a command on an event (which is pretty easy with Xorg's
xbindkeys
) and therefore fully customizing behavior of key and mouse event.. I believe Wayland is trying to be more secure and disables this behavior.In any case, you still have the opportunity to switch to Xorg pretty easily and enjoy the functionality.