USB mouse buttons
Doug White
dwhite at gumbysoft.com
Tue Jul 27 19:15:14 PDT 2004
On Mon, 26 Jul 2004, Alexander Motin wrote:
> I have Logitech MX510 mouse with 8 buttons. When I connect it to USB
> port I take message:
> Jul 26 18:07:58 orphanage kernel: ums0: Logitech USB-PS/2 Optical Mouse,
> rev 2.00/21.00, addr 2, iclass 3/1
> Jul 26 18:07:58 orphanage kernel: ums0: 7 buttons and Z dir.
>
> As I understand ums driver do not support mouses with more then 7
> buttons because of:
> #define MAX_BUTTONS 7 /* chosen because sc_buttons is u_char */
>
> But sc_buttons is int as I can see inside /usr/src/sys/i386/isa/mse.c
Thats the old Microsoft bus mouse driver, not the syscons mouse handling
stuff. sc_buttons is probably a dated reference, or a reference to NetBSD
(we share a lot of USB code with them).
src/dev/syscons/sysmouse.c appears to only have enough room in the
sysmouse protocol to support 10 buttons, which would imply that it can get
sent more than 7 :-) Further investigation of the interface in
sys/mouse.h finds a bitfield big enough for 28 buttons. You'll have to use
the mapping feature to cram that down to the 10 you want, if you have a
device with more than 10 buttons.
Try upping that to 20-something and rebuilding things and see what you
get. If you get a panic, something's still amiss.
--
Doug White | FreeBSD: The Power to Serve
dwhite at gumbysoft.com | www.FreeBSD.org
More information about the freebsd-hardware
mailing list