lkml.org 
[lkml]   [2000]   [Jan]   [7]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 06 Jan 2000 21:09:42 -0500
FromBlake Scholl <>
SubjectSupporting mice with >3 buttons
Hi,

    I've been doing small amount of work on getting the 2 side buttons
(buttons 4 and 5) on my USB Explorer Mouse to work under Linux.  Perhaps
I could get some feedback on whether my understanding of the current
situation is correct and what might be a good, long-term solution for
supporting mouse devices.

    From reading kernel sources, it is my present understanding that the
PS/2 mouse protocol used by the psaux and USB mouse devices support only
3 mouse buttons -- extra bits in the buttons byte of the protocol seem
to be used for indicating the sign of motion along the x,y, and z axes.
Last time I checked (2.3.35), both the USB mouse drivers (mouse.c and
now in mousedev.c) and the psaux drivers (psaux.c) both mask off
everything but the lower 3 button bits received read from the mouse.

    I'm a little confused as to why the extra sign bits are necessary,
since the ps2 protocol sends dx, dy, and dz as signed 2's compliment
numbers.

    As a proof of concept, I made slight modifications to mouse.c so
that it will pass to user-level the exact buttons byte read from
hardware.  I also made slight changes to xf86_mouse.c from XFree86-3.3.5
to recognize the changes.  The extra buttons worked as expected under X
without a hitch. (Unfortunately, "Zaxismapping" to support the scroll
wheel under X makes it difficult to use 5 buttons and a scroll wheel at
the same time, but this is an X issue not a kernel one.)

    In the future, would it make sense to perhaps write some sort of a
"smart" kernel mouse driver and protocol, which could supply the
user-level with extra information, such as number of buttons, axes,
etc., allowing a single protocol to support a wide variety of mice,
including ones which haven't been developed yet.  Or, would meaning
putting a lot of driver smarts in the kernel that rightfully belong at
the user level?

    Given that since changes to the ps2 protocol require corresponding X
modifications, what kind of modification would be appropriate in the
standard kernel?  Perhaps a CONFIG_USB_MOUSE_EXTRABUTTONS or the like?


Thanks for the feedback and info.

Blake



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [from the cache]
©2003-2008