Strange bug with mouse wheel scrolling

Zephaniah E. Hull warp at aehallh.com
Wed Apr 12 04:47:53 PDT 2006


On Wed, Apr 12, 2006 at 12:33:59PM +0200, Matthias Hopf wrote:
> On Apr 11, 06 16:41:59 -0400, Zephaniah E. Hull wrote:
> > > In fact if I do cat -A /dev/input/mouse0 I see no unusual events. So I very
> > > much doubt this is a hardware issue.
> > 
> > Oh, joy, another one of these.
> > 
> > Under one variation of a ps2 mouse protocol with wheel, the byte used
> > for indicating wheel movement is just a signed byte which can show more
> > then just one step of movement in either direction.
> > 
> > For another common variation this is somewhat different, one value for
> > moved up one step, another for down one step, one for moving the second
> > wheel one step, another for moving the second wheel the other direction
> > one step..
> 
> Wow, this explains everything! Thanks, Zephaniah.
> It's also clear why this didn't occur earlier, because the buttons for
> horizontal wheels weren't mapped by default before.
> 
> > So, fix the protocol init and parsing to keep us talking the right
> > protocol and the problem should go away.
> 
> Do you have information or pointers about how to detect the different
> protocols? Appearantly something in the code isn't right, so I don't
> want to read the code to find out...

Not even a matter of detection, you're talking to the kernel's emulation
of a mouse.

drivers/input/mousedev.c an a current 2.6.

You can detect by writing a 0xf2, which will give back 0xfa and 0, 3, or
4 depending on what protocol.

But it will never, ever, talk a protocol you didn't ask it to, basic by
default or after reset, and for imps2 you write out 0xf3, 200, 0xf3,
100, 0xf3, 80, for imex2 you write out 0xf3, 200, 0xf3, 200, 0xf3, 80.

(Those are the resolution setting commands, defined in the base
protocol, so really you should write it out, then ask to make sure that
you've gotten the right mode.

There are some catches here with some brain dead OEM Logitechs which
will give people writing mouse driver init code nightmares, but since
you're going to be talking to the kernel most of the time...)

IMPS2 only has the one wheel, EXPS2 has the two.

Looking at the code, they seem to actually try and use a range of the
bits for each of it, nasty, but I suppose it makes sense, I forget if
gpm could parse it though.

Anyhow, that should give enough information to fix things to know which
protocol you've asked the mouse to talk in.

Let me know if I can help more.

Zephaniah E. Hull.
Former Debian gpm maintainer.
Current xf86-input-evdev maintainer, because it's _much_ less painful.

-- 
	  1024D/E65A7801 Zephaniah E. Hull <warp at aehallh.com>
	   92ED 94E4 B1E6 3624 226D  5727 4453 008B E65A 7801
	    CCs of replies from mailing lists are requested.

I still do not understand why manglement believes that cutting off the
oxygen flow to the brain will INCREASE productivity. The reason they
made that decision is probably because they couldn't think clearly due
to wearing neckties.
  -- Paul Tomko on ASR.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20060412/1b619a88/attachment.pgp>


More information about the xorg mailing list