Workaround: 6 button moused

The Anarcat anarcat at anarcat.ath.cx
Mon Apr 7 14:03:31 PDT 2003


On Mon Apr 07, 2003 at 03:19:19PM -0500, Dan Nelson wrote:
> In the last episode (Apr 07), The Anarcat said:
> > Ok, i've done a little research on my own.
> > 
> > There is a maximum of 31 buttons set in sys/mouse.h:
> > 
> > #define MOUSE_MAXBUTTON		31
> > 
> > ..so that's probably not the issue. Thinking the problem might be more
> > a matter of mapping between X and moused, I've run moused -d -f to see
> > what was going on. A log is attached. It was recorded when pressing:
> > 
> > 1- left mouse button
> > 2- middle mouse button
> > 3- right mouse button
> > 4- "sixth" mouse button (the thumb button)
> > 5- wheel up
> > 6- wheel down
> 
> Why do you call it the "sixth" button? 

Because it's the sixth button of the mouse if you count the mouse
wheel up and down as "buttons".

> What are buttons 4 and 5 (and don't say wheel up/down, those aren't
> buttons :)

Hmm.. Yes, I thought wheel up/down. :) But let's say things as you
want and say it's the "fourth" button we're talking about and mouse
wheel/up are not buttons.
 
> I think you might need to simply change your XF86config file to read
> 
>    Option      "YAxisMapping" "5 6"
> 
> since on a standard 3-button/wheel mouse it's "4 5". 

No. YAxisMapping determines which "buttons" move the *mouse cursor* on
the Y-axis. I tested it. It makes my mousewheel move the cursor up and
down, very cute. ;)

> I know "ZAxisMApping" is what you had, but the manpage says
> YAxisMapping is the one you need. 

Where?

> Docs for the mouse driver in X are unfortunately obscured by the
> FreBSD mouse manpage, but you can get to them with
> 
> man -M /usr/X11R6/man mouse
>  or
> lynx /usr/X11R6/lib/X11/doc/html/mouse.4.html 

Reading that:

       Option "YAxisMapping" "N1 N2"
              Specifies  which buttons are mapped to motion in the Y direction
              in wheel emulation mode.  Button number N1 is mapped to the neg-
              ative  Y axis motion and button number N2 is mapped to the posi-
              tive Y axis motion.  Default: "4 5".

and also:

       Option "ZAxisMapping" "N1 N2 N3 N4"
              Set the mapping for the Z axis  (wheel)  motion  to  buttons  or
              another  axis (X or Y).  Button number N1 is mapped to the nega-
              tive Z axis motion and button number N2 is mapped to  the  posi-
              tive  Z axis motion.  For mice with two wheels, four button num-
              bers can be specified, with the negative and positive motion  of
              the  second  wheel  mapped respectively to buttons number N3 and
              N4.  Default: no mapping.

But your idea made me try something new:

        Option      "ZAxisMapping"  "5 6"

duh. But this gives me odd results. My "fourth button", as you call
it, acts like a mouse wheel and one mouse wheel "button" doesn't work.

I had to ues this to make it work properly:

$ xmodmap -e 'pointer = 1 2 3 6 4 5'

There's probably a better way to do this, but at least this way, my
"fourth" button generates an event that xev(1) can see!

Hourra!

A.

PS: I think the problem might be due to applications hardcoding
"button4 and button5" as mouse wheel up/down, instead of relying on
some ZAxis semantics... 

-- 
Conformity-the natural instinct to passively yield to that vague something
recognized as authority.
                        - Mark Twain
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20030407/f827f359/attachment.bin


More information about the freebsd-questions mailing list