Logitech MX Revolution Mouse on Linux

2006 December 27
tags: , ,
by kevin

This document describes setting up the Logitech MX Revolution Mouse on Linux, however, the process would be similar for any Logitech MX* mouse.

Caveat: These notes are my best recollection of the process on Ubuntu Edgy Eft (6.10), although there is very little in the process that is special to Ubuntu so this should work on most distributions running X.Org 7.1. If you find anything inaccurate please email the author so that I can make corrections.

Get the evdev Driver

Make sure that you have the evdev driver for you distribution. RPM users you will want the xorg-x11-drv-evdev RPM and Debian based distros will want the xserver-xorg-input-evdev package.

Overview

Firstly, you want to use the xorg evdev driver and not the default mouse driver. Once the driver is installed, which it probably is with most distributions, you will need to edit your /etc/X11/xorg.conf file. After you have the xserver recognizing your mouse you can then map the buttons to the functions you wish. The setup described here will allow the xserver to recognize all of the buttons on the mouse.

Get Device Info

The first thing you will need to do is get the device information for your mouse by issuing the command: cat /proc/bus/input/devices. In the output look for the block that contains a line beginning with H: Handlers=mouse similar to the following:

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

Pay particular attention to the line that begins with P: Phys=usb- as you will need this information for editing /etc/X11/xorg.conf.

edit xorg.conf

Once you have the device info you can edit your xserver configuration. You will want to comment out the old InputDevice section for your old mouse and create a new section similar to the following:

Section "InputDevice"
        Identifier      "Configured Mouse" # This can be any string you want
        Driver          "evdev"

       # Just configure one of the following two Options

        Option          "Phys"  "usb-*/input0" # USB port independant
#       Option          "Device" "/dev/input/event1" # USB port dependant
        Option          "CorePointer" # must exist after Phys or Device

  # If CorePointer isn't declared then the xserver won't
        # recognize all of the buttons

#       Option          "Name"  "Logitech MX Revolution" # not necessary
#       Option          "ZAxisMapping"  "4 5" # not necessary
#       Option          "Resolution"    "800" # doesn't make a difference
EndSection

It is important to keep the order of the options when declaring the device with either the Phys or Device and then marking the input device as the CorePointer. Please note the comments that I have placed in the configuration. Some options are commented out only to illustrate what is the minimum configuration. You can add the options if you like but it is unnecessary to get everything working.

The only bits that you should have to change from the example above is the line that reads Option “Phys” “usb-*/input0. The bolded information should match that which you discovered from the device information from the first step. The Phys option is preferable over the Device option because the physical declaration allows you to plug the mouse micro tranceiver in any USB port. If you use the device declaration then the USB micro tranceiver must remain in the exact same USB port.

It is also necessary to make sure that the InputDevice section you have configured is referenced in the ServerLayout section:

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "Default Screen"
        InputDevice     "Generic Keyboard"
        InputDevice     "Configured Mouse"
        InputDevice     "stylus" "SendCoreEvents"
        InputDevice     "cursor" "SendCoreEvents"
        InputDevice     "eraser" "SendCoreEvents"
EndSection

One of the lines that reads InputDevice must reference the Identifier you used in your mouse configuration section. Note that the configuration above is only if you have one pointer device. If you wish to configure multiple pointers then try this article that describes how to configure multiple pointing devices.

Get Button Info

Once you have configured the xserver, restart it and you can now check out what buttons are available to the xserver. The utility xev will allow you to discover the button numbers. Just run xev and press each of the buttons and move the scroll wheels in the little on-screen box and note the output in the terminal window. Here are my buttons which should be consistent for all MX Revolution mice:

Left Click 1
Right Click 3
Left&Right Click 2
Scroll Up 4
Scroll Down 5
One-Touch Search *
Scroll Tilt Left 7
Scroll Tilt Right 6
Thumb Wheel Click 17
Thumb Wheel Forward 13
Thumb Wheel Backward 15
Forward Thumb Button Click 9
Back Thumb Button Click 8

Note that the One-Touch Search button doesn’t actually generate a button action but rather a key mapping.

If you play with the buttons and their actions you will quickly notice a few annoyances. Firstly, besides clicking the left and right mouse buttons simultaneously, no button is mapped to the traditional X Windows middle mouse button. Also, the left and right scroll tilting is counter intuitive in that tilting the scroll wheel right causes a horizontal scroll bar to go left! We will rectify these problems in the next section.

Map the Buttons

To straighten out the goofy scroll wheel tilting and map a sane middle mouse button, do the following as your regular user. This will map a middle mouse button to clicking the thumb wheel.

echo -e "pointer = 1 17 3 4 5 7 6 8 9 10 11 12 13 14 15 16 2n" > ~/.Xmodmap

Misc.

There is a project called the logitech-applet that apparently allows you to boost the resolution of the mouse to its maximum. Some information can be found in A complete guide to a Logitech mouse. This article also touches on mapping buttons to particular keystrokes using xvkbd and xbindkeys if you really want to be fancy.

3 Responses leave one →

Trackbacks & Pingbacks

  1. Extra Mouse Buttons not detected by xev - openSUSE Forums
  2. New linux user questions - Overclock.net - Overclocking.net
  3. Back in Action: iTunes is the only #fail for putting on Linux pants » Victus Spiritus

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS