evdev: keyboard or mouse?

Sebastian Glita glseba at yahoo.com
Fri Nov 28 05:58:22 PST 2008


The mice and keyboards in xf86-input-evdev/src/evdev.c:EvdevProbe handle a "multiple-capability" device wrong for my use.

I have a wireless USB receiver so I use both a mouse and a keyboard with the same token.

In `hal-device`, the device for the mouse also has "input.keys" matching "info.capabilities".

I tried in /etc/hal/fdi/10-x11-input.fdi to <remove> from "info.capabilities" the "info.keys" from this strlist. It works.

The problem is that in `gnome-device-setup' when I drag the name from the Virtual Core Pointer it goes only to a keyboard item, and not to the "pointer" one (its "use" matches IsXExtensionKeyboard instead of IsXExtensionPointer).

The "evdev" device is added/configured via ioctl's and the configuration from hal seems not to be used (it would say weather it originated from matching either "input.mouse" xor "input.keys").

This small permutation in evdev.c works for me (it disables `has_keys' in favor of XI_MOUSE to XI_KEYBOARD):


    has_axes = FALSE;
    has_keys = FALSE;
    num_buttons = 0;

    /* count all buttons */
    for (i = BTN_MISC; i < BTN_JOYSTICK; i++)
        if (TestBit(i, key_bitmask))

    if (TestBit(REL_X, rel_bitmask) && TestBit(REL_Y, rel_bitmask) ||
        TestBit(ABS_X, abs_bitmask) && TestBit(ABS_Y, abs_bitmask))
        has_axes = TRUE;

    for (i = 0; i < BTN_MISC; i++)
        if (TestBit(i, key_bitmask))

    if (i < BTN_MISC)
        has_keys = TRUE;

    if (has_axes && num_buttons)
        has_keys = FALSE;

and the rest is almost identical as from #1352, but no `has_keys' assignment.

Thanks -- S.


More information about the xorg mailing list