TuX as LLG logo
Driver Suite for Linux
csv2iif.pl suite
convert PayPal transactions to IIF, OFX, QIF
DMX30 Interface
128Ch SPP
DMX43 Interface
2out 2in EPP
LED Hardware
for Linux and Windows
EPROM Sampler
for 8 bits of sound
Linux drivers for MK3/4 PCI
PostgreSQL replication
C exception/signal handling lib
to various software
and small scripts
misc documents
to lighting stuff

XFree86 Configuration for a 7 Button USB Mouse

Okano 7 button USB Mouse

I have purchased my mouse at the german retailer Karstadt. It is labeled as: Okano Optikmaus - Model Nr: 1300 - Article Nr: 0186160024. It is also sold as Belkin F8E850-OPT. However this is just the oem version of some asian mass product, so I assume this mouse is sold as different brands as well. If you know any of those please contact me.

The linux input subsystem recognizes this mouse as:

Manufacturer: Cypress Sem.
Product: PS2/USB Browser Combo Mouse
input: USB HID v1.00 Mouse [Cypress Sem. PS2/USB Browser Combo Mouse]

The named manufacturer Cypress makes the usb controller chip used by the mouse for communications.

The mouse has 4 distinct buttons and a combined button/wheel. The wheel events are transmitted as button clicks as well (similar to all other mice). The picture shows the location of the buttons:

  1. Left Button
  2. Mouse Wheel when pressed
  3. Right Button
  4. Left side (thumb) button
  5. Right side button
  6. Mouse Wheel Up direction
  7. Mouse Wheel Down direction
The difficulty with this setup arises from the wheel events transmitted as buttons 6 and 7. X11 expects wheel events on buttons 4 and 5, so we have to remap those buttons. Unfortunately the docs from XFree86 contain a wrong example how to setup a 7 button mouse. This document tries to give and explain a working configuration.


The configuration for XFree86 4.x is straightforward. The following excerpt only shows the mouse device configuration. Please adjust your current config accordingly. The device /dev/mouse should be a symbolic link to the real mouse device. If your kernel supports the input subsystem, this should be something like /dev/input/mouse0 or the aggregated mouse device /dev/input/mice (which I use).

Section "InputDevice"
	Identifier	"usbmouse"
	Driver		"mouse"
	Option		"Device" "/dev/mouse"
	Option		"Protocol" "ExplorerPS/2"
	Option		"Buttons" "7"
	Option		"ZAxisMapping" "6 7"

If you use the x.org X11 Server, leave out the Buttons option.

correcting X events

Although X now correctly recognizes all events send by the mouse, your applications will no be able to use the mouse wheel and instead react to the side buttons. As mentioned earlier the button numbering does not convey to the standard. We have to remap the mouse buttons in the X server. There are two ways to accomplish that.

You can add a line to your ~/.Xmodmap which is read at X startup. Please add the following: pointer = 1 2 3 6 7 4 5. Upon restart of X your mouse buttons should work as expected.

If you don't want to alter your Xmodmap file or it did not work, you can also use the program xmodmap. The command xmodmap -e "pointer = 1 2 3 6 7 4 5" should remap the buttons. Please try this command in an xterm. If it works, you should add the command to either or both of your ~/.xinitrc and ~/.xsession, so the command is issued at X startup.

In the x.org X11 distribution you have to use the following expression for xmodmap: pointer = 1 2 3 10 11 4 5 6 7 8 9.

Using Buttons 4 & 5

The additional buttons 4 & 5 are not used by default by many applications. This results mostly from the fact, that X itself only has (official) support for only 5 buttons (which include the wheel buttons). But with the help of a tool called imwheel we can remap arbitrary buttons to key events. I found that you should patch the default configuration /etc/X11/imwheel/imwheelrc so the browsers Mozilla/Firefox and Konqueror interpret the thumb buttons correctly. Replace the section for Mozilla-bin with the following lines:

,	Up,	Button4
,	Down,	Button5
,	Left,	Alt_L|Left
,	Right,	Alt_L|Right

,	Up,	Button4
,	Down,	Button5
,	Left,	Alt_L|Left
,	Right,	Alt_L|Right


If you want to open the mouse you'll have to take off the white pads to access the screws. My mouse then looks like this and this.


Please contact me if you have any questions or suggestions about this page. If you know of other mouse devices which need remapping, please give me some data of those devices.
Dirk Jagdmann <doj@cubic.org>


Colas Nahaboo X mouse wheel scroll page contains many more configuration examples and configurations for many applications to make use of the mouse wheel. Another page with configuration hints for mice and keyboard comes from the waikato linux users group and the Gentoo Wiki. Vojtech Pavlik the author of the Linux input subsystem wrote an FAQ about mice and keyboards on Kernel Trap. And the official documentation Mouse Support in XFree86. Markus Raab has managed to use a left and right handed mouse simultaneously.
And if you need 15 extra buttons go for the prohance mouse. They even have a 70 buttons version.

http://llg.cubic.org © 2001-2017 by Dirk Jagdmann