ButtonMapping for a 5-button mouse

Phil Endecott spam_from_xorg at chezphil.org
Wed May 10 12:34:29 PDT 2006


A while ago I asked:
> I've just bought myself an Evoluent Vertical Mouse, and I'm trying to 
> get it to work properly with X.
> This is a USB mouse with three normal buttons, a wheel which is between 
> 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
> 
> 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.
> I'm not sure yet about the thumb button, but duplicating the left button 
> might be as good a choice as anything.
> 
> I think that the key to this must be the ButtonMapping option.  I have 
> tried various things and I can reliably change the behaviour of the 
> lower-numbered buttons.  But as soon as I have any ButtonMapping option 
> present, buttons 8 and 9 are completely disabled (according to xev). 
> Even this:
> 
>     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.
[snip]

No replies - so either I was asking in the wrong place, or this is 
something no-one has encountered before.  I suspect that the 
ButtonMapping code has some hard-coded limit on the number of buttons.

Anyway, I have worked around it by not using ButtonMapping at all and 
instead using this xmodmap rune, which I'll paste here in case someone 
stumbles on this while searching for an X config for this Evoluent 
Vertical Mouse:

	pointer = 1 8 2 4 5 6 7 3 9 10 11 12 13

This does basically what I want: the three main buttons are buttons 1, 2 
and 3, and the scroll wheel works.  It seems that this method doesn't 
allow you to have multiple physical buttons mapped to a single logical 
button.  Depressing the scroll wheel does nothing useful, but by adding 
this to xorg.conf:

Option EmulateWheel true
Option EmulateWheelButton 9

dragging with the thumb button depressed also generates wheel events, 
which is useful.

Entries for 10, 11, 12 and 13 seem to be necessary, though I'm not sure 
why.  Something thinks the mouse actually have 13 buttons.

Cheers,

--Phil.




More information about the xorg mailing list