John Martin wrote:
> Alan Coopersmith wrote:
>> Peter Schow wrote:
>>
>>> http://www.engadget.com/2009/11/06/openofficemouse-isnt-free-isnt-pretty/
>>>
>>>
>>> Will this rodent, including all 18 buttons, be fully useable on
>>> OpenSolaris?
>>>
>>
>> I'm not sure it will be usable by any normal human. If one were to try,
>> they'd hit the 10-button limit of the VUID protocol between the kernel
>> mouse drivers and the X server, though the kernel could just claim those
>> are keyboard keys to get past that - certainly look like them.
>>
>>
> A quick scan of the Xorg mouse driver indicates it supports up to 24
> buttons.
In sun_mouse.c, the code to interpret a VUID event read from the kernel:
if (pVuidMse->event.id >= BUT_FIRST && pVuidMse->event.id <= BUT_LAST) {
/* button */
int butnum = pVuidMse->event.id - BUT_FIRST;
In /usr/include/sys/vuid_event.h:
#define BUT_FIRST (VKEY_FIRSTFUNC) /* 32544 */
#define BUT(i) ((BUT_FIRST)+(i)-1) /* 32544+i-1 */
#define BUT_LAST (BUT_FIRST+9) /* 32553 */
If we seriously wanted to support it, the simplest way would be to declare that
if you read a KEY_LEFT(i) event from a mouse, it was really BUT(10+i), since
that's the next range of VUID event codes, and the odds of a mouse having
actual keys is low. (Or we could finally decide that using the VUID protocol
from SunView no longer makes sense and define a new kernel -> Xorg event
protocol, probably one that looks like the one used by the Linux evdev driver.)
--
-Alan Coopersmith- alan.coopersmith at sun.com
Sun Microsystems, Inc. - X Window System Engineering