I recently bought a gamer mouse (Trust Predator GM-4800 Laser Gamer Mouse Elite). After some trial and error I found a tool to easily enable and configure the extra mouse buttons that were not immediately recognized. In this tutorial I will explain how to install and configure a tool called btnx, to enable the extra mouse buttons.
NOTE: This method will not works for Ubuntu Intrepid Ibex and later because the foundation btnx built upon are changed in those versions
1. Install btnx
add the following lines at the end of /etc/apt/sources.list :
deb http://ppa.launchpad.net/daou/ubuntu hardy main
deb-src http://ppa.launchpad.net/daou/ubuntu hardy main
run the following commands to install btnx and btnx-config
sudo apt-get update
sudo apt-get install btnx
2. Run btnx
Applications > System Tools > btnx
To run the btnx-config configuration gui.
(you will have to enter an administrator password)
3. Configure btnx
In the right pane press the button Detect mouse & buttons and follow the instructions.
If all went well the Vendor and Product ID will now have a hexadecimal code.
On the buttons tab, you'll have to enter the key combinations that will be executed when the mouse buttons are pressed. Here are some examples:
*Alt+Right. i.e. Firefox forward:
(Originally Mouse Wheel Right on MX Revolution)
keycode = KEY_RIGHT
mod1 = KEY_LEFTALT
*Alt+Left. i.e. Firefox backward:
(Originally Mouse Wheel Left on MX Revolution)
keycode = KEY_LEFT
mod1 = KEY_LEFTALT
*Ctrl+Alt+Left. For switching workspaces to the Left:
(Originally Thumb Wheel Backward on MX Revolution)
keycode = KEY_LEFT
mod1 = KEY_LEFTCTRL
mod2 = KEY_LEFTALT
*Ctrl+Alt+Right. For switching workspaces to the Right:
(Originally Thumb Wheel Forward on MX Revolution)
keycode = KEY_RIGHT
mod1 = KEY_LEFTCTRL
mod2 = KEY_LEFTALT
*Alt+LeftMouseButton. For dragging windows.:
(Originally Thumb Wheel Press on MX Revolution)
keycode = BTN_LEFT
mod1 = KEY_LEFTALT
*Ctrl+PageDown. For moving Right through tabs (Firefox, gnome-terminal, etc.):
(Originally Thumb Button Forward on MX Revolution)
keycode = KEY_PAGEDOWN
mod1 = KEY_LEFTCTRL
*Ctrl+PageUp. For moving Left through tabs (Firefox, gnome-terminal, etc.):
(Originally Thumb Button Backward on MX Revolution)
keycode = KEY_PAGEUP
mod1 = KEY_LEFTCTRL
*Play/Pause. Sends a play/pause key event:
keycode = KEY_PLAYPAUSE
*Volume Up. Sends a volume up key event:
keycode = KEY_VOLUMEUP
*Volume Down. Sends a volume down key event:
keycode = KEY_VOLUMEDOWN
*Volume Mute. Sends a volume mute key event:
keycode = KEY_MUTE
*Email. Sends a keyboard mail command:
keycode = KEY_MAIL
*XF86Forward. i.e. Konqueror forward:
keycode = KEY_FORWARD
*XF86Back. i.e. Konqueror back:
keycode = KEY_BACK
*Next Song:
keycode = KEY_NEXTSONG
*Previous Song:
keycode = KEY_PREVIOUSSONG
Off course other key combinations are also possible, very handy for gaming. You can use different configurations (first tab) for different tasks, like browsing, gaming, coding etc.
(Don't forget to enable the buttons.)
After you have configured the button actions, (re)start btnx
sudo /etc/init.d/btnx restart
That's it, your extra buttons should now work like you've configured them
From the developer:
Good and bad news. Bad news first. Ubuntu Intrepid Ibex, which is to be released in October, breaks the foundations that btnx was built on. It seems that the kernel input event pipes can no longer be read. It is most likely related X.Org v.7.4. This means I will stop all development of btnx.
Comments
Post new comment