I have managed to install xbindkeys on my lubuntu 16.04 box, which I think is the correct tool for me to use to map a simultaneous left and right mouse button click to emulate a middle mouse click.

I originally thought I should do this using the openbox configuration file (I am using lxde with openbox) but couldn't find a way of doing it.

Can I do this with xbindkeys? If so how? I can't get my head around how the system works as I am totally unfamiliar with it.


No, xbindkeys can't detect simultaneous button presses. But you don't need that to emulate a middle click on left+right click: it's a built-in feature.

You can turn it on with the xinput program. See Make mouse movements scroll when the middle button is held down for a tutorial. In a nutshell:

  • Run xinput list to list available input devices. Locate the name of your mouse device; I'll use My Mouse Device in my answer.
  • Run xinput list-props 'My Mouse Device' to list the available properties. One of them should be Evdev Middle Button Emulation.
  • Run xinput set-prop 'My Mouse Device' 'Evdev Middle Button Emulation' 1

Once you have the command right, add it to your autostart list, i.e. create a .desktop file in ~/.config/autostart. See Running program on startup (Fedora 22/ 2015) for an example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.