Logitech MX Revolution on Ubuntu Lucid 10.04

The first beta for the latest Ubuntu is out, so I’m running it already. Aside from the strange window controls, it seems good so far. One of my first tasks was to make my gorgeous Logitech MX Revolution mouse work properly. Out of the box is… almost, just one little thing to solve – the “media wheel” by your thumb does nothing.

First, install xautomation and xbindkeys
sudo aptitude install xautomation xbindkeys
Xautomation is a program that can simulate key presses or mouse clicks when it’s run, and xbindkeys allows you to run a script when a specific button is pressed. Since Ubuntu doesn’t know about the buttons on the mouse, we’ll fake them!

Thanks to cecilx22 on ubuntuforums, I know the buttons of the MX Revo:
# Mappings for keys for MX Revo
# b:1 - left mouse button
# b:2 - left and right mouse button together
# b:3 - right mouse button
# b:4 - mouse wheel up
# b:5 - mouse wheel down
# b:6 - mouse wheel left
# b:7 - mouse wheel right
# b:8 - back button
# b:9 - forward button
# b:10 - -none-
# b:11 - -none-
# b:12 - -none-
# b:13 - media wheel up
# b:14 - -none-
# b:15 - media wheel down
# b:16 - -none-
# b:17 - media wheel press

So it’s 13 and 15 we’re interested in. Fire up a text editor – gedit is fine, or something hardcore and command line. You’re editing a file called ~/.xbindkeysrc – don’t forget that it won’t show up in your home directory as files starting with a dot are hidden unless you press ctrl+alt+h. Here’s the contents of my .xbindkeysrc:
#Media Scroll Wheel Up
"/usr/bin/xte 'keydown Control_L' 'key Page_Down' 'keyup Control_L' &"
b:13

#Media Scroll Wheel Down
"/usr/bin/xte 'keydown Control_L' 'key Page_Up' 'keyup Control_L' &"
b:15

The command when button 13 is triggered is Ctrl+Page_Down – notice how you have to say press and release for each button – and Ctrl+Page_Up for button 15. This means that the thumb wheel moves through tabs in your browser and page up/down in text files – perfect!

One last thing – to make this happen every time you start up, go to System > Preferences > Startup Applications. There you’ll need to add a new program, xbindkeys to startup.

Enjoy the new mouse – everything else works exactly as I want: browser back/forward, search button, middle click, side scroll. One thing to investigate if your scroll wheel isn’t doing what you want is revoco, which is a tiny program for just that one thing, though I don’t need it.


Update: (May 2011) I have used this same setup on the newer versions of Ubuntu – 10.10 Maverick Meercat and 11.04 Natty Narwhal – with complete success.

  • James

    I just wanted to say thank you, the steps you posted work perfectly for my using Lucid 10.04. I had forgotten about it since btnx stopped working way back when… Do you know if btnx works again? I’ll probably never care as long as the buttons work now, but that used to be a nice app to use.

  • Erik

    BTNX works again, not quite as well as before.

  • Programgeniusyu

    Hi,

    I have question about Ubuntu 10.04 LTS and setting my MX Revolution to
    work in MAYA 2011..

    I need to setup “Second Mouse Wheel Press (Thumb Wheel)” to do the “Alt
    + Middle Mouse Button”…?

    I try
    > ;; specify a mouse button
    > (xbindkey ‘(“b:17”) “alt b:2”)
    >
    > But no luck

    Thanks in advance,
    Sasha

  • Anonymous

    Try something like:
    “/usr/bin/xte ‘keydown Alt_L’ ‘mouseclick 2’ ‘keyup Alt_L’ &”
    b:17
    in .xbindkeys.rc

  • Frank

    Iḿ trying to have support for CTR_L + Alt_L + key_right in order to rotate the cube.

    “/usr/bin/xte ‘keydown Control_L’ ‘keydown Alt_L’ ‘key Key_Right’ ‘keyup Control_L’ ‘keyup Alt_L’ &” b:13

    only moves my cursor endlessly to the right.

    Where do I go wrong?

  • David P.

    Has anyone ever gotten the ability of main scroll wheel to go into free scroll when you flick it like from withing MS Windows?

  • BlindOne

    I’ve followed this guide a couple of times. Flawless! Working great on Mint13. Now if I could just get the search button working correctly

  • jonrogersuk

    I’ve done the same thing too – every time I reinstall ubuntu from scratch – that’s the mark of a successful & useful post! Not sure what problem you have with the search button – I never use it and I’m on Ubuntu anyway.

  • Panos

    In xte the key_right is declared as “Right”