Bug#369917: xserver-xorg-input-mouse: Gets number of buttons wrong, even if Option "Buttons" specified
> I find that the server is getting the number of buttons wrong (too
> high).
>
> (**) Configured Mouse: ZAxisMapping: buttons 9 and 10
> (**) Configured Mouse: Buttons: 14
For reference this button count appears to be coming from mouse.c l.706,
/* get maximum of mapped buttons */
for (i = pMse->buttons-1; i >= 0; i--) {
int f = ffs (pMse->buttonMap[i]);
if (f > pMse->buttons)
pMse->buttons = f;
}
That is, the original value is being reset to the value of
ffs(pMse->buttonMap[i]), where this is larger. The larger number
appears to be ("actual" number)+4. At a guess, the extra 4 buttons
correspond to the X- and Y-axes, with the normal mouse wheel occupying
the Z-axis.
ffs is defined or referred to in /usr/include/xorg/compiler.h
and ../xf86_libc.h (xserver-xorg-dev). A low level definition is found
in /usr/include/asm-generic/bitops/ffs.h, "find first bit set"
I suspect this is not actually a bug.
Drew
Reply to: