Logitech Revolution MX in Fedora and CentOS

I was finally able to get my mouse working with all buttons in Fedora and CentOS. Previously, I used btnx to set up my Revolution MX, but I could never configure the middle search button. I also needed a replacement since btnx will no longer be updated. This post on the Ubuntu forums helped me get it working with xbindkeys and xmacroplay on my home system. I had to do a little more work to get it working on my Fedora 10 system at work, since xmacroplay is not available in any yum repositories that I know of.

First install xbindkeys:

sudo yum install xbindkeys -y

The other package you’ll need is xmacro. I created x86_64 and i386 RPMs based on this source rpm. Download the appropriate RPM for your arch and install.

x86_64

wget http://nate.ccv.brown.edu/rpm/xmacro-pre0.3-20000911.0.x86_64.rpm

sudo yum localinstall xmacro-pre0.3-20000911.0.x86_64.rpm -y –nogpgcheck

i386

wget http://nate.ccv.brown.edu/rpm/xmacro-pre0.3-20000911.0.i386.rpm

sudo yum localinstall xmacro-pre0.3-20000911.0.i386.rpm -y –nogpgcheck

screenshot-keyboard-shortcuts

If you plan on using the middle Search button, you’ll need to unbind it in Gnome. Go to the Keyboard Shortcuts, usually in System > Preferences. Find the “Search” action, click it, and hit Backspace. That should unbind the keyboard command that the MX sends with that middle button.

Then you’ll need to configure your xbindkeys settings. In your home folder, create a ~/.xbindkeysrc file and copy the default button codes for the MX into it (commented out).

gedit ~/.xbindkeysrc

# Mappings for keys for MX Revo
# b:1    –    left mouse button
# b:2    –    left and right mouse button together
# b:3     –    right mouse button
# b:4    –    mouse wheel up
# b:5    –    mouse wheel down
# b:6    –    mouse wheel left
# b:7    –    mouse wheel right
# b:8    –    back button
# b:9    –    forward button
# b:10    –    -none-
# b:11    –    -none-
# b:12    –    -none-
# b:13    –    media wheel up
# b:14    –    -none-
# b:15    –    media wheel down
# b:16    –    -none-
# b:17    –    media wheel press

Then you’ll need to define the keypresses for each button you’d like to configure. You should be able to get an idea on how to assign buttons with my config listed below. I bind the mouse wheel left/right so I can move between tabs in Firefox (Ctrl+tab and Ctrl+Shift+tab). For the media wheel, I set it up to open a new tab in Firefox (Ctrl+T), close a tab/application (Ctrl+w), and to minimize (Alt+F9). And I assign the middle search button to middle click.

# Mapping for mousewheel right
“echo ‘KeyStrPress Control_L KeyStrPress Shift_L KeyStrPress Tab KeyStrRelease Tab KeyStrRelease Shift_L KeyStrRelease Control_L’| xmacroplay :0”
b:6
“echo ‘KeyStrPress Control_L KeyStrPress Tab KeyStrRelease Tab KeyStrRelease Control_L’ | xmacroplay :0”
b:7

# Mappings for media wheel
“echo ‘KeyStrPress Control_L KeyStrPress t KeyStrRelease t KeyStrRelease Control_L’ | xmacroplay :0”
b:13
“echo ‘KeyStrPress Control_L KeyStrPress w KeyStrRelease w KeyStrRelease Control_L’ | xmacroplay :0”
b:15
“echo ‘KeyStrPress Alt_L KeyStrPress F9 KeyStrRelease F9 KeyStrRelease Alt_L’ | xmacroplay :0”
b:17

# Mappings for middle button
“echo ‘ButtonPress 2 ButtonRelease 2’ | xmacroplay :0”
c:0xE1

Then start xbindkeys and test.

xbindkeys -n -vsessions

Once you’re satisfied with the setup, you can add xbindkeys to start with your Gnome session. System > Preferences > Sessions. Add a new session item with “xbindkeys” – no quotes and no arguments.


About this entry