Logitech MX Revolution in Linux

Update: Froese has written a tool to control the wheel-click behavior. See comment #6 below.

I picked up a Logitech MX Revolution mouse, sort of unsure of whether I could get all its functions working under SUSE Linux Enterprise Desktop 10.

The mouse is nice, and lends itself quite well to xgl and compiz. The only portion I haven’t been able to get working yet is the thumb-wheel (xev shows keyboard events o [ and Enter). It looks like an upgrade to X.org 7.1 or 7.2 is required to fix that, as a number of users have reported in the comments below.
In case anyone is interested, here is what I had to do to /etc/X11/xorg.conf to get the rest of it working, including the tilt wheel, the search button, and the two thumb buttons.

Section "InputDevice"
Identifier   "Mouse[1]"
Driver       "evdev"
Option       "Device" "/dev/input/event4"   # cat /proc/bus/input/devices
Option       "Name" "Logitech MX Revolution"
Option       "CorePointer"
EndSection

The “Device” bit may be different for you – type cat /proc/bus/input/devices and look for the two Logitech sections, which will be something like this:

I: Bus=0003 Vendor=046d Product=c51a Version=4101
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:1d.0-2/input0
S: Sysfs=/class/input/input4
H: Handlers=mouse2 event4
B: EV=7
B: KEY=ffff0000 0 0 0 0 0 0 0 0
B: REL=143

I: Bus=0003 Vendor=046d Product=c51a Version=4101
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:1d.0-2/input1
S: Sysfs=/class/input/input5
H: Handlers=kbd event5
B: EV=f
B: KEY=c0002 400 0 0 1 f80 78000 6639fa d84157ad 8e0000 0 0 0
B: REL=40
B: ABS=1 0

The line we are interested in is Handlers, but notice the device registers as a keyboard and a mouse. Make sure you choose the one for the mouse, which is “event4″ in this case.

The last thing you need to change in xorg.conf is make sure any of your other pointing devices are still working. I have the Logitech as Mouse[1], and the touchpad and pointing stick on my ThinkPad T60p ast Mouse[2] and Mouse[3] respectively. You should not have to modify those sections except to make sure there are no name conflicts.

Finally, my ServerLayout section looks like this:

Section "ServerLayout"
Identifier   "Layout[all]"
InputDevice  "Keyboard[0]" "CoreKeyboard"
InputDevice  "Mouse[1]" "CorePointer"
InputDevice  "Mouse[2]" "SendCoreEvents"
InputDevice  "Mouse[3]" "SendCoreEvents"
Option       "Clone" "off"
Option       "Xinerama" "off"
Screen       "Screen[0]"
EndSection

After all these steps, everything should work on the mouse except the Search button. The thumb-wheel is generating keyboard events (the o, [, and Enter keys), which currently makes it useless. I haven’t figured out how to deal with that. The two thumb buttons are mouse buttons 8 and 9, which I have mapped to some things in compiz.
The search button was pretty easy for me, although it works a little differently than it would under Windows. On a Windows machine, you can highlight some text, click the search button, and it will open your favorite search engine and search for that text.

With SLED 10, we have Beagle, which I thought would be a better use of the button anyway. However, clicking the button won’t submit any search terms – just open the search tool.
The search button is actually treated as a keyboard button, with keycode 122. What you need to do is map this to a keysym, so that you can use that symbol to define an action under keyboard shortcuts. The way I did that was to add the following to $HOME/.Xmodmap:

keycode 122 = XF86Search

You also may or may not have to add the following to your Gnome session startup:

/usr/X11R6/bin/xmodmap $HOME/.Xmodmap

You can see the current key mapping by typing “xmodmap -pk” in a terminal, and looking for keycode 122.
After restarting X, you can run xev in a terminal, and test pushing the search button. You should see the key symbol XF86Search in the output. All that remains is to map that key symbol to your desired action. Since I am using compiz-quinn, I used compiz settings manager (csm) to add a custom command to run /usr/bin/beagle-search. Then I specified the XF86Search key to execute that command.

If anyone knows how to get the thumb wheel working correctly, let me know!

Share

25 Responses to “Logitech MX Revolution in Linux”


  • I just got one of these too. Do you know if it’s possible to change the scroll mode behavior under linux? I love the mouse, but don’t think I can use it without my beloved middle click. I would like to be able to switch from clicky scroll to free scroll, but I don’t want middle click to do that. Any clues?

  • Got this mouse too – all buttons working!
    Using:
    gentoo 2006.1
    modular xorg 7.1
    xf86-input-evdev 1.1.2-r2

    xorg.conf:
    Section “InputDevice”
    Identifier “MxEvdev”
    Driver “evdev”
    Option “CorePointer”
    Option “Protocol” “auto”
    Option “Device” “/dev/input/event2″
    EndSection

    regards, johoe

  • Seriously, I think the universe does not want me to email you, since every time I do the message gets returned.

    Anyway, call or email and let’s set up a day for the families to get together.

  • Hi,

    I am trying to get one of these working in Fedora Core 5 – most of the buttons worked after some playing with .Xmodmap, just the 2nd wheel to go – for some reason, xev detects no button presses at all when I move the second wheel!

  • For me, the thumb wheel started working when I upgraded to x.org 7.1. The only thing that still doesn’t work is the middle click. It just switches from clicky-scroll to smooth scroll, there’s still no way to control that behavior under linux like there is in the windows drivers.

  • Here’s a small tool for Linux to control the wheel behaviour of the MX-Revolution. It lets you switch between free-spin, click-to-click, manual, and auto mode. For manual mode you can specify any button to be used for mode switching and for auto mode you can specify a speed at which free-spin mode is entered (speed range is wider than that of Logitech’s setpoint software). The middle (wheel) button is available to apps in all modes except in manual=3 mode.

    http://goron.de/~froese/revoco-0.1.tar.gz

    Have fun and spread it, ET.

  • The only way I’ve found to get a middle click is to use the thumb wheel click as the middle click using xmodmap (pointer = 1 17 3 4 5 8 9 6 7 10 11 12 13 14 15 16 2 18 19 20).

  • Here is a xorg.conf bit that is not dependent on the bus you have connected your mouse:

    Section “InputDevice”
    Identifier “Mx Rev”
    Driver “evdev”
    Option “Protocol” “Auto”
    Option “Name” “Logitech USB Receiver”
    Option “Phys” “usb-*/input0
    EndSection

  • Froese, you did it, personal hero status awarded.

    Works absolutely perfectly (version 0.2)
    you can even set a different threshold for upward and downward automatic, which suits me fine as I tend to have a faster down scroll than an up scroll.
    Btw changing anything on the clicking state via “revovo” automatically releases the wheel to be button 2 again.
    It is exactly the thing we’ve all been waiting for.
    There are also undocumented features like soft-click/soft-free, which enables one to automate the click behavior according to the window the pointer is over, without a constant switching to and from clicking mode. Soft-* means the change of state occours only if the wheel is used at all.

    I bow deeply.

  • I have written the following little script:

    #!/bin/bash

    if $(cat /var/lock/wheel/free)
    then
    echo false > /var/lock/wheel/free
    /usr/local/bin/revoco temp-free
    else echo true > /var/lock/wheel/free
    /usr/local/bin/revoco auto=5,7
    fi

    which I then hotkeyed to key 122 (Xf86Search) so I can toggle easily between free-wheel and auto mode.
    Just in case anyone is interested.

    Sadly I am not able to use the implemented query command of revoco, so I had to use that ugly lockfile solution.

    Anyway, this pretty much resembles the last missing feature of the win* driver.

    Btw, the 0.3 Version of revoco even is able to change the the mode permanently, beyond reboot.

  • Hi from Spain!
    It seems that Froese’s site is down, or at least i cannot reach it. Can anyone send it to me, or put it somewhere me or anyone else can donwload it, please!

  • Don’t worry, i got it somewhere else. But thanks anyway! Merry xmas!

  • Working Search button
    (just like in Windows) with Klipper
    (so only useable for those who has KDE)
    i’ve just assigned XF86Search keycode to code 122
    xmodmap -e “keycode 122 = XF86Search”
    and then assigned shortcut to
    Klipper’s Manually invoke action on current clipboard action.
    Then created action called Search with regular expression ^. (i know that there should be something better but i don’t know much about regular expresions)
    and with the command to that action
    ps x |grep -q ‘[f]irefox’ && firefox -search %s || firefox -search %s

  • Apparently both option name and device are not required and under fedora core 6 xorg. 7.1 putting the name option causes x not to start correctly.

  • Nice work guys, saw the mouse yesterday in shop, fell in love… I wanted to check if it was supported, well, seem it is :D
    I’m going to buy it right this afternoon. By the way… The klipper trick should be adaptable to a gnome environment too.
    There is a “glipper” utility available for gnome altough i never tryed it, should do the trick. Even Better… The famous deskbar applet have a feature to automatically search for the content of the copy buffer when you press a key.
    If you don’t like neither of this solutions, I think there /should/ be a way to issue a “search for whatever” command on all the major linux browsers (firefox, konqueror, epiphany, opera). But I have no idea how to put the content of the copy buffer in a command line…
    If it is possible, one will actually be able to map different search engine/programs on shortcuts:

    SearchButton + W = generic internet search for $copy_buffer
    SearchButton + W + I = wikipedia search for $copy_buffer
    SearchButton + F = files search for $copy_buffer
    SearchButton + B = Beagle search for $copy_buffer
    (Yeah, klipper actually /ask/ the user what to do with the copied content, but in case you don’t use kde…)
    Now I have a question: is there a way to map a keyboard key press to a mouse button in X itself? Like, I press the thumb button and it generates “XWhatever” instead of “Button #”.
    I’m asking because neither kwin/metacity/compiz/beryl supported mouse buttons for keybinding last time i checked. I know there are external program that do this, but I’d like Xorg itself to do it for me.
    Thanks, and excuse my poor english, bye.

  • Hmmm.. the revoco tool seems pretty good, but I can’t get the bloody thing to work. :(

    f00f@tux ~ $ revoco manual=6
    revoco: HIDIOCSUSAGES: Invalid argument

  • @f00fbug: Tried being root?

    BTW I discovered that to identify the mouse in xorg.conf you can just use the “Name” option and plug the thing wherever you want.

  • If it doesn’t work, try plugging it into a different USB port. I had everything configured correctly, and my Xorg.0.log output had lots of stuff about finding the mouse, detecting the buttons, et cetera, but then it had the lines:

    (II) LogitechVX-usb-0000:00:1d.1-2/input0: On
    (II) LogitechVX-usb-0000:00:1d.1-2/input0: Off

    and my mouse wasn’t working. Removing the dongle from my powered USB hub and plugging it into my mainboard made everything work.

  • Doesn’t work even as root, and it is plugged into the main USB port. However I’m going to update my kernel pretty soon, so maybe that’ll help.

  • This article was very very useful, both in its body and its comments. I certainly would’ve spent far more time going over manuals looking for the bit where you needed to use “evdev” as the driver rather than “mouse”.

    Thank you. Please make sure this entry remains available for as long as possible! (Whatever happened to the HOWTO format?)

  • Thanks guys for the thread. It’s the kindness of others that keep us from pulling our last hairs out. Appreciate the posts and hard work. Helped me tremendously.

  • One way to use the contents of the copy buffer as an argument is to use the program “xclip” (http://people.debian.org/~kims/xclip/) with the -o option. The problem is that the clipboard contents may be multi line, and very long.

    To run the command “firefox -search ‘clipboard contents’” as suggested above by oxymoron, you could use (single line command):

    perl -e ‘$_=`xclip -o`; s/[\r\n\s]+/ /g; s/^(.{250}).*/$1/; exec(“firefox”, “-search”, $_);’

    This will convert the clipboard contents to a single line, collapse whitespace to a single space, then truncate to 250 characters, as most search engines can’t deal with too long searches. Any other browser could be used in place of firefox here, as the variable $_ contains the reformatted clipboard contents.

    To attach it to the search button on the mouse, and have it work with any window/session manager, first assign the search button to XF86Search as suggested above:

    xmodmap -e “keycode 122 = XF86Search”

    then using xbindkeys (http://hocwp.free.fr/xbindkeys) place the two lines:

    “perl -e ‘$_=`xclip -o`; s/[\r\n\s]+/ /g; s/^(.{250}).*/$1/; exec(“firefox”, “-search”, $_);’”
    XF86Search

    in your .xbindkeys file. Note that xbindkeys is great for assigning any action to any mouse button or key press (like volume up/down and mute keys), and is window/session manager independent.

  • Anyone have any ideas on using a VX revolution and not an MX revolution. The device numbers are different and revoco says no device found.

    Could I simply change the code to accept a VX revolution as well and get away with it?

  • Thanks for the info but geez what a pain to get middle-click working.

    I rarely use control-c, control-v, rather I highlight text then middle click to paste, which I really miss with the MX Revolution.

    Most of these howto’s seem to change the behavior of the MX Revolution scroll wheel so it accepts pressing it as a middle-click, but if the scroll wheel still mechanically toggles back and forth between free floating and “normal” scrolling with the ticking noise, it does not seem ideal.

    I was thinking it would be better to make the small button right behind the scroll wheel the middle-click button. It seems to do nothing by default. Has anyone tried?

  • I agree to rem, middle-click to paste will be helpful.

Comments are currently closed.