Comment 28 for bug 54191

Revision history for this message
In , Peter Hutterer (peter-hutterer) wrote :

On Thu, May 27, 2010 at 03:10:41AM -0700, <email address hidden> wrote:
> > well, that's the theory but IIRC for usb mice that field is always set,
> > curtesy of the PS/2 protocol not allowing any button detection.
>
> What's this then? (from Xorg.0.log)
>
> (II) Logitech USB-PS/2 Optical Mouse: Found 3 mouse buttons

we're getting that data from the kernel though. the kernel sets those based
on the HID protocol descriptors but for older mice (though arguably those
don't matter much anymore) it's the PS/2 protocol. and that doesn't have a
detection mechanism so the kernel always sets those bits (link below, line 568).

so evdev will always think there's a 3+ button mouse because that's what the
kernel tells us. Now, the interesting thing would be what happens for
2-button USB mice - I don't actually know and I don't think I've got such a
device available to me.

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/input/mouse/psmouse-base.c;h=979c50215282025fef1c7fa795a6bf20fedfcad4;hb=HEAD