How to configure a multi mouse button in Linux

Posted by & filed under .


I just got a multi mouse button for the first time, I usually was avoiding them because I was sure they wouldn’t work in Linux. I was wrong. Here’s a short and easy tutorial on how to configure one. For my mouse and what I wanted to do, there’s 2 buttons on the left side and I wanted to be able to use one that will double-click (select a word, open a file) and the other button to triple-click, so that I can select a whole paragraph of text with just one click instead of three.

Install easystroke, it should be in your distribution repository already, so a simple “sudo apt-get install easystroke” or something like that is all you need. Once installed, open it up, either by running “easystroke” in a terminal or in the KDE menu it’s found in Applications / Utilities. Go in the “Preferences” tab, click “Add” and in the grey box, just click with the button you want to use.

Install xdotool, very popular software, it is most certainly already in your distribution repository and go back in easystroke, go in the “Actions” tab. This is where you tell your mouse’s button, what to do when you press it. Click on “Add Action”, give it a name, the “Type” will be “Command”, the “Details” will be this command:

xdotool click --repeat 3 1

The number 3 means that it will repeat 3 times a click and the number 1 means that the click is binded to the mouse button 1 which is also the left click. Then, the “Stroke” will be the mouse button you want to click 3 times. Do the same thing for the other button but use “–repeat 2” instead. It should look like this:

screenshot24 screenshot23

If you want your mouse button to do something else, you need to modify the value in the “Actions” tab, for example, instead of “Command”, if you choose “Key”, you can make it so that your mouse button will do a keyboard combination key like CTRL-A to select everything. It’s quite configurable.

And finally, to make it so that easystroke start at boot, in KDE, go in Applications / Settings / System Settings, then in System Administration / Startup and Shutdown, click “Add Program…” and choose easystroke. That’s it! No need to mess in the kernel or modify xorg.conf where you need to restart X everytime you need to try out the new configuration!

Leave a Reply

Your email address will not be published. Required fields are marked *