map mouse buttons.

I have LEAP 42.3 installed with XFCE, I’d like to map the roller button to an browser back command when pressed.
The XFCE mouse applet doesn’t recognize the button as anything but a two button mouse, although the scroll wheel works.
Where to start?

How does libinput enumerate the device?

xinput  list

The following will capture events associated with input events such as button pressing/releasing

sudo libinput-debug-events

This ArchWiki page discusses button-remapping with libinput…

EVENT3 POINTER_BUTTON +22.19s BTN_MIDDLE (274) pressed, seat count 1
sudo libinput-debug-events event3 POINTER_BUTTON +22.42s BTN_MIDDLE (274) RELEASED, SEAT COUNT: 0

Somehow you mangled that output…always best to copy paste the command and output, and enclose within

[/COD.]tags (refer to the '#' button in the forum editor).

Install and use xbindkeys to bind a mouse button to the required command…

Now that I’ve had a chance to investigate this further, the following should help with identifying the pertinent mouse button…

xev | grep -A 2 Button

Along, with xbindkeys, the xte utility (from the xautomation package) can be used to emulate key presses, and used in the ~/.xbindkeysrc configuration file to be executed on a mouse button push. This is outlined in the blog I linked to already and should do what you’re trying to achieve…

This trick can also be used to map the back/forward buttons on the mouse. Here we can’t use D-Bus, since we want to “talk” to the active window and not a specific application. Fortunately for us, most applications use the key shortcuts Alt+Left and Alt+Right for Back and Forward, respectively. In other words, we can do something like this: # Back
“xte ‘keydown Alt_L’ ‘key Left’ ‘keyup Alt_L’”


“xte ‘keydown Alt_L’ ‘key Right’ ‘keyup Alt_L’”
This’ll work in Dolphin, Konqueror, Firefox, and basically any application that use the same shortcut for Back/Forward.

*You’ll need to change the button values to suit your input device of course.

Hope that helps. :slight_smile:

Thank you!
That worked perfectly!

Good to know that worked for you!