evdev: keyboard or mouse?

Peter Hutterer peter.hutterer at who-t.net
Sun Nov 30 15:41:10 PST 2008


On Fri, Nov 28, 2008 at 05:58:22AM -0800, Sebastian Glita wrote:
> 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 device probing is independent of HAL, so removing this key won't affect
evdev at all.

> 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).

Unless someone has actually taken the code and advanced it, I wouldn't trust
on gnome-device-setup 100%. Try xinput --reattach <mouse name> "Virtual core
pointer" and see if that works.

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

please always submit code changes as diffs, otherwise it's too hard to figure
out what the actual change was.

>     if (has_axes && num_buttons)
>         has_keys = FALSE;

No. Doing so means you essentially disable all keys on the device. I've seen
keyboards that advertise buttons and axes (scrollwheel) so you'd be disabling
all these keyboards.


Cheers,
  Peter



More information about the xorg mailing list