Monthly Archive for September, 2006

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 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"

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]"

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!