11.11.09

Solving MX-Revolution Click-To-Click / Free-Spin issues on Linux - the udev way

Being the (proud ?) owner of an MX-Revolution mouse, one is immediately confronted with some extremely boneheaded innovative design choices by Logitech engineers, the most outstanding of which is the mouse-wheel behavior.

See, for some reason the designers of the mouse believed that changing the mouse-wheel scroll behavior is so important it far overshadows the usefulness of middle-click and so owners of the mouse are left to discover they cant have normal middle click functionality out of the box.

Fortunately for us, there exists a small utility called revoko (found here and hopefully coming soon to a distro repository near you) which allows for control over this annoyance feature.

Having googled my woes, I came across a fellow Logitech victim owner who wrote-up a short guide about how to solve this issue automatically every boot-up/resume using init scripts.

What I present here is, in my opinion, a better option, using udev.
Why do I think using udev is better ?
  1. Instead of editing 2 locations I'm only adding a single rule file.
  2. This method should work even if the mouse is connected at some point after booting up / resuming, as it responds to the connection event.
  3. configuring hardware is udev's stated purpose (but this is aesthetic  nit-picking)

So, on with the howto:

  1. get revoco, from your distribution's repository if at all possible. If your distro doesnt provide it (like ubuntu 9.10, at the time of this writing) download the latest revoco source code from here, unpack it somewhere, and compile revoco by issuing "make" when in the extracted directory, this should create a small executable file called "revoco" in the same directory. copy this file over to /usr/local/bin (sudo), or any other place you find appropriate (don't forget to update PATH if you're using someplace else).
  2. time to add a udev rule for your MX Revolution. To do this locate your udev rules directory. Under ubuntu 9.10 default rules are stored at /lib/udev/rules.d/ and custom local rules under /etc/udev/rules.d/. I chose to add my rule in the custom directory.
  3. create a new file (call it logitech-mx-revolution.rules to make sure you know whats there later and that it runs last). The file should probably be owned by root, so you should use sudo.
  4. the contents of the file should be something like

    #################################################################
    # customize Logitech MX Revolution mouse scroll-wheel
    #
    ATTR{idVendor}=="046d", ATTR{idProduct}=="c525", ACTION=="add", RUN+="/usr/local/bin/revoco click"

    this is assuming you'd like your mouse to be set to click-to-click. if you want a different configuration, consult the revoco help.

and thats basically it. I've tested this on my machine, and it works. feel free to leave a comment if you find otherwise.

3 comments:

  1. Hi mate, this solution has ALMOST got it working for me. its so close i can taste it. the only problem is that it does not seem to work on its own because of permissions. if i run the line "/usr/local/bin/revoco click" in terminal, the i get:

    revoco: No permission to access hiddev (/dev/usb/hiddev0-15)
    Try 'sudo revoco ...'

    sudo /usr/local/bin/revoco click works ok, but i dont know how to get this to work automatically rather than me manually terminaling that it each time. (sorry pretty new to linux :S)

    ReplyDelete
  2. 1st of all, what particular distribution have you tried this on ?
    a couple of things you could try:
    1. you could set the setuid flag on the revoco executable. this flag, once set on an executable file, tells the OS that whoever runs this file "inherits" the file owner's permissions while running it - so that if revoco is "owned" by root, running it will grant it root permissions. for further info, see http://en.wikipedia.org/wiki/Setuid
    2. you could edit the sudoers conf file to allow "sudo"ing revoco without a password. instructions on how to do that (assuming your using ubuntu) can be found here https://help.ubuntu.com/community/Sudoers

    ReplyDelete
  3. hiya, whoops. sorry. yes, this is ubuntu 10.04.

    i tried doing chmod +x on '/usr/local/bin/revoco click' but no luck.

    im gonna have a crack at this visudo stuff i think

    ReplyDelete