ButtonMapping for a 5-button mouse

Matthias Hopf mhopf at suse.de
Thu May 11 07:47:10 PDT 2006


On May 04, 06 19:56:30 +0100, Phil Endecott wrote:
> This is a USB mouse with three normal buttons, a wheel which is between 

According to your finding, these are not 'normal' buttons, in the sense
that it has three buttons + a wheel button, which makes 4 buttons on the
top side.

> the left and middle buttons, and a fourth button under the thumb.  By 
> default, according to xev, the buttons are as follows:
> 
> 1: left button
> 2: pressing the wheel
> 3: middle button
> 4 & 5: turning the wheel
> 8: right button
> 9: thumb button

Pressing the wheel is assumed to be the middle button, so this seems
to be somewhat correct.

> I'd like to have the following allocation:
> 
> 1: left button
> 2: middle button
> 3: right button
> Plus whatever is needed for wheel rotation, presumably 4 and 5.
> Pressing the wheel could also act as button 2.

Try

Option "ButtonMapping" "1 2 2 3 8"

Meaning:
- pressing phys. button 1 (left)   will create event 1 (left)
- pressing phys. button 2 (wheel)  will create event 2 (middle/wheel)
- pressing phys. button 3 (middle) will create event 2 (middle/wheel)
- pressing phys. button 4 (right)  will create event 3 (right)
- pressing phys. button 5 (thumb)  will create event 8 (unknown #1)

Event 8 is left to the applications whatever they want to do with it (no
standard behavior). ZAxisMapping seems to be ok by default in your
setup.

> I'm not sure yet about the thumb button, but duplicating the left button 
> might be as good a choice as anything.

Option "ButtonMapping" "1 2 2 3 1"

> 	Option "ButtonMapping" "1 2 3 4 5 6 7 8 9"
> 
> Here I'm asking it for a 1-to-1 mapping, but buttons 8 and 9 now report 
> nothing in xev.

The buttons are physically labeled 4 and 5, now creating events 4 and 5,
which are masked for ZAxisMapping.

Mouse configuration isn't trivial, that's right, but it's better than
before now.

> - By default, it decided that the mouse had 7 buttons.  This is sort-of 
> true, since 6 and 7 are missing.  I have tried with 'Option Buttons 9' 
> and it still seems to fail.

The total number of buttons *reported* includes the wheel events. You
specify with Option "Buttons" how many *physical* buttons the mouse has.
There is no support for more than 5 buttons in PS/2 protocols so far.

Matthias

-- 
Matthias Hopf <mhopf at suse.de>       __        __   __
Maxfeldstr. 5 / 90409 Nuernberg    (_   | |  (_   |__         mat at mshopf.de
Phone +49-911-74053-715            __)  |_|  __)  |__  labs   www.mshopf.de



More information about the xorg mailing list