Logitech MX Revolution

From ArchWiki
Revision as of 02:37, 29 April 2009 by Ilikepudding (Talk | contribs) (Created page with '---- '''Originally Posted by NobodySpecial on the forums''' April 12, 2007: Many of us were using BTNX to run the buttons on the MX Revolution. But BTNX is now broken with the ...')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Originally Posted by NobodySpecial on the forums April 12, 2007:

Many of us were using BTNX to run the buttons on the MX Revolution. But BTNX is now broken with the new XORG. The good news is, the new XORG is good enough that you don't really need BTNX, for the most part.

Here's how I use mine. First, I'm not even using the evdev driver - I guess you could. But "mouse" works fine: /etc/X11/xorg.conf

   Section "InputDevice"
   Identifier    "MX Rev"
   Driver        "mouse"
   Option        "CorePointer"
   Option        "Device"        "/dev/input/mice"
   Option        "Protocol"        "auto"
   Option        "ZAxisMapping"        "4 5"
   Option        "Emulate3Buttons"    "no"
   Option        "Buttons"        "3"

To start, install a couple packages:

   sudo pacman -S xbindkeys xvkbd

Then find the buttons you want with xev and enter in ~/.xbindkeysrc My code under ~/.xbindkeysrc makes the thumb buttons go forward/back and also the middle mouse wheel rock left/right will change tabs in firefox:

   "/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[Left]""
     m:0x0 + b:8
   "/usr/bin/xvkbd -xsendevent -text "\[Alt_L]\[Right]""
     m:0x0 + b:9
   "/usr/bin/xvkbd -xsendevent -text "\[Control_L]\[Page_Up]""
     m:0x0 + b:6
   "/usr/bin/xvkbd -xsendevent -text "\[Control_L]\[Page_Down]""
     m:0x0 + b:7

To automate, add /usr/bin/xbindkeys to System -> Pref -> Sessions. Next, I like the left-sided wheel to rotate the desktop in compiz: Compiz Settings -> Desktop -> Rotate Cube -> Bindings -> Initate "Button17", Rotate Left "Button13", Rotate Right "Button15" Finally, its annoying to me that the middle button below the scroll wheel is set to "search". Its far handier to have it as the middle mouse click. The only way I found to do this is through Xmodmap, which isn't ideal, but works (PLEASE post here if you know a better way). To list xmodmap keys: xmodmap -pk OR xmodmap -pke Under xev above, my button gives "keycode 225", so I do this:

   echo "keycode 225 = Pointer_Button2" >> ~/.xmodmaprc

Log out and in again - gnome should autodetect the ~/.xmodmaprc file. The trick only works when "mousekeys" are on. So either gnome-keyboard-properties -> Mousekeys -> Enable pointer OR toggle with SHIFT-ALT-NUMLOCK (you want to be able to toggle so you can use the numeric keypad at times). However, the xmodmap trick has one more issue - it messes up keybindings in vmware. This solved it for me:

   echo "xkeymap.nokeycodeMap = true" >> /etc/vmware/config

Originally Posted by WCentauri on the forums August 14, 2008:

I suggest a slightly different way to handle the mapping of the search button to middle click. The output from xev lists the button as XF86Search, and it can also be referenced as c:0xE1. It should be possible to map the search button with xbindkeys by referring to c:0xE1 or XF86Search and using the xmacro package available in the AUR. The corresponding entry for xbindkeys is

   "echo 'ButtonPress 2 ButtonRelease 2' | xmacroplay :0"

I'm not sure that xvkbd can remap mouse buttons. Perhaps this is why xmodmap was used in the first place. xmacro can handle keyboard and mouse buttons, so the other entries in .xbindkeysrc could be transformed to xmacroplay calls. I don't have a compelling reason (besides aesthetics) for doing so, other than anecdotal claims that xmacro has less overhead than xmacro. This may or may not be true, and it may not matter for practical purposes anyway.

There is a big thread ([1]) brewing on the Ubuntu forums about the death of btnx, and that is where this technique comes from.