Subject: Re: How to make 4th mouse button work
To: Juan RP <jrp@hispabsd.org>
From: Bryan P <u10@terran.org>
List: netbsd-help
Date: 07/24/2003 01:29:53
On the distinguished day of Jul 24, Juan RP wrote:

> On Thu, 24 Jul 2003 00:15:05 -0700
> Soren Jacobsen <soren@blef.org> wrote:
>
> > On 07/24 00:01, Bryan P wrote:
> > > Hello,
> > >
> > > I have a PS/2 Logitech trackball mouse with 4 buttons.  I connect it
> > > to my NetBSD-current laptop via a PS/2 -> USB converter.  Three of
> > > the buttons work fine (in X).  The fourth has no effect and generates
> > > no event under xev.  I also have a scrollwheel touchstrip on my
> > > laptop that I've successfully set up to work as a scroll wheel under
> > > X.  Both input devices can work fine simultaneously under X.  Is
> > > there any way I can get that 4th button to work?
> >
> > mouse(4) has:
> >        Option "Buttons" "integer"
> >               Specifies  the  number  of mouse buttons.  In cases
> >               where  the  number  of  buttons  cannot  be   auto-
> >               detected, the default value is 3.
> >
> > Perhaps setting that to 4 will work.
>
> I don't think so, perhaps Buttons 6 ? heh
> Because he has 4 buttons + 2 more buttons of the wheel
> ( Z & Y | up | down ) afaik ...

This is where it gets tricky.  The built-in mouse is a two-button touchpad
with a scrollwheel - so that's four logical buttons.  I use
emulate3buttons, "buttons 5" (I also tried 6) and "zaxismapping 4 5".  So
far so good.

The external mouse, which sometimes isn't plugged in, has 4 buttons and no
scroll wheel.  It is a PS/2, but it's connected using a USB converter and
the ums driver.  Three of those buttons work normally, but the 4th does
nothing.  Ideally I'd like the builtin mouse to always work the same (the
way it works now) regardless of whether the external mouse is connected,
and the external mouse to have 4 buttons.  I know the fourth button
physically works because I see an interrupt on my mouse when I click it.
:-)

Interestingly, this is what I see when I connect the external mouse:

uhidev1 at uhub0 port 1 configuration 1 interface 1
uhidev1: Tangtop Generic USBPS2, rev 1.10/0.01, addr 2, iclass 3/1
uhidev1: 3 report ids
ums0 at uhidev1 reportid 1: 3 buttons and Z dir.
wsmouse1 at ums0 mux 0
uhid0 at uhidev1 reportid 2: input=2, output=0, feature=0
uhid1 at uhidev1 reportid 3: input=1, output=0, feature=0

"3 buttons and Z dir".  But there are actually four, so... ?

-bp
--