DEV Community

Cover image for Enabling Mouse Middle Click Emulation in Linux
Brama Udi
Brama Udi

Posted on

Enabling Mouse Middle Click Emulation in Linux

What i mean about "Middle Click Emulation"? Hmm, this is like a feature that allow you to emulate a middle click using combination of both left and right click, really good if you hate (or was broken) the mouse wheel click.

As i remember some linux like "Linux Mint" enable it by default, but if you try on your current linux os and it doesn't work then follow these step to enable.

Prerequisite

  • xinput installed, i.e. if you are on debian distro you can install it with apt package manager when dont have it, apt-get install xinput.

Steps

1.) Find your mouse device ID

xinput
Enter fullscreen mode Exit fullscreen mode

In my case the mouse ID are 8

xinput output

2.) Find mouse "emulate" props ID

xinput list-props 8
Enter fullscreen mode Exit fullscreen mode

In result above we've found props ID for Emulate Middle Click is 265 and they still have a 0 value.

xinput-list-props

3.) To enable it lets change the Emulate Middle Click value to 1

xinput set-prop 8 265 1
Enter fullscreen mode Exit fullscreen mode

xinput-set-prop

Thats all, you can place the last command xinput set-prop 8 265 1 to $HOME/.profile or $HOME/.bashrc file for presistent changes after reboot.

Discussion (0)