Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Can anyone tell me how to configure all the buttons on a Logitech MX 620 mouse (http://www.logitech.com/en-us/support/mice/2987) under Ubuntu 12.04?

Specifically, I like to make one of them just the ctrl key (for control clicking webpages) and another one ctrl-w to close tabs. I also normally make the scroll wheel page down for each click (otherwise it hurts my arms to be scrolling so much). I make pushing the wheel to the left = pageback and pushing to the right = page forward.

I've searched for other answers to this and found something related here: http://ubuntuforums.org/showthread.php?t=1789807

But when I posted a followup post to solve the issue, no one responded --perhaps I made the mistake of posting to a question that had been "solved." I'm not sure how I'm supposed to reopen a question that is pertinent to my question but doesn't quite solve mine.

Thank you for any help.

share|improve this question
    
I think this is the easiest way to get the mouse working with full functionality: ralf-oechsner.de/opensource/page/logitech_performance_mx –  Edward Kennedy Feb 28 at 22:20

6 Answers 6

You're going to need several applications for this, to install them run

sudo apt-get install xbindkeys xautomation xev  

Step 1

You need to find the button numbers for the buttons on your mouse. Run xev. You will see a litle white windows appear, put your mouse in it and press your mouse buttons (it's best to do this one button at a time). You should get output like this for each button:

ButtonRelease event, serial 41, synthetic NO, window 0x4c00001,
root 0x2e9, subw 0x4c00002, time 25804905, (31,28), root:(821,80),
state 0x110, button 1, same_screen YES

(note: xev also capture mouse movement so you might need to sift through mouse movement events to find your button events. I recommend opening a new xev session per mouse button)

This is what is important from that output: button 1. That tells us that particular button is button one. I would store this in a .txt file for now.

Step 2

Create the xbindkeys config file using:

xbindkeys --defaults > $HOME/.xbindkeysrc  

Next we need to add the key/button bindings to the config file. You can open this file with gedit $HOME/.xbindkeysrc. This is where the fun begins. We are going to use xte to set bindings to our buttons.

To make a button act as Ctrl we would add:

"xte 'key Control_L'"
b:1  

This would bind Ctrl to mouse button one.

If you will tell me the button numbers of your buttons and what you want each to do, I will write the script for you.

share|improve this answer
    
You made my day, thank you very much. –  nana Sep 26 '13 at 14:29
    
@seth: I would like to configure buttons 8 & 9 to be "back" and "forward" respectively. Better yet, if I could figure out where to fint the commands that I can configure with xbindkeys, that would be great. Thanks, Dan –  dbbd Jun 26 at 9:46
1  
The easiest way to reduce the insanity of the xev output is by running the output through grep: xev | grep -A2 ButtonPress ; this will leave all the mouse motion events, focus events, etc. and just show the ButtonPress events. –  Eric Lambart Sep 19 at 18:46
    
@dbbd Apparently I missed your message somehow. I will look into it and get back to you. –  Seth Sep 19 at 21:54

You should install Solaar, a Linux tool that allows you to manage Logitech Unifying Receiver mice and keyboards, that comes with both a GUI and command line interface. To do that add the following repository and install by executing the following commands:

sudo add-apt-repository ppa:daniel.pavel/solaar

sudo apt-get update

sudo apt-get install solaar

This will allow you to increase and maximize you mouse's DPI, monitor battery, enable smooth scrolling and side scrolling. To get the multi window and zoom button working you can visit this site which walks you through the easy steps to get the functionality you are looking for:

http://www.ralf-oechsner.de/opensource/page/logitech_performance_mx

share|improve this answer
    
I did this on my C720/crouton. When I ran solaar, it crashed back to the start screen. I had to restart (and figure out the command was sudo startxfce4) and removed solaar. –  marty cohen May 15 at 22:44

I've been trying to do something similar, and I've come across this page: http://ubuntuforums.org/showthread.php?t=65471

Hopefully it works for mx 620 as well.

share|improve this answer

I have a Logitech MX 500 and wanted to map the lateral keys with Copy and Paste actions (it is very useful).

I used this guide to understand how to configure the xbindkeysrc file and be able to map the keys.

share|improve this answer
    
You know that moving the mouse pointer to the start/end of the text you want to copy and then press down the left button and keep holding it till you get to the end/start of what you want to copy and it's copied. When you want to paste you press the middle button (if you just have a two button mouse, press both left and right button at the same time) and you paste the text. No need to configure anything, this is out of the box on all Unix and Linux machines with a XWindows System. Please keep in mind we ain't using a featureless microsoft product but GNU/Linux –  user350566 Nov 20 at 14:29

I followed the @Seth's instructions, but the binding I wanted was to for the thumb button an the M705 to do CTRL + Left-click (for opening links in a new tab in chrome browser). The binding I needed to add was this:

"xte 'keydown Control_L' 'mouseclick 1' 'keyup Control_L'"
    b:10 + Release

It waits for the thumb button to be released, and then presses control key, performs the mouse click, then releases the control key.

share|improve this answer

in Debian you have a xbindkeys-config package which will help you configure your key/button bindings. So do:

sudo apt-get install xbindkeys-config
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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