Blacklisting an Input Device

Peter Hutterer peter.hutterer at who-t.net
Wed Dec 29 14:55:55 PST 2010


On Wed, Dec 29, 2010 at 11:27:18AM -0600, Gabriel Beddingfield wrote:
> Hello,
> 
> On Wed, Dec 29, 2010 at 2:51 AM, Peter Hutterer
> <peter.hutterer at who-t.net> wrote:
> >>   1. Create a file in xorg.conf.d that maps the
> >>      device (MatchProduct "Hercules DJ") to an
> >>      empty driver (Driver "").
> >
> > The "official" solution is to use
> >   Option "Ignore" "on"
> 
> Thanks, Peter!
> 
> However, I wonder if the attached patch to xf86-input-evdev might be
> appropriate.
> 
> ...or if it would be more appropriate for me to change something in
> the kernel driver....  :-)
> 
> Peace,
> Gabriel

> Device must have buttons to be configured as a mouse.
> 
> In commit 71e9a69ed68257e5ded26c062a9797de571bb880 (2009-Apr-29)
> has_axes was split into has_rel_axes and has_abs_axes... and this
> resulted in the following change:
> 
> 	-    if (has_axes && num_buttons) {
> 	+    if (has_rel_axes || has_abs_axes || num_buttons) {

no, there's a few devices that only have wheel axes and they need to keep
working. Note that the "configured as mouse" message is probably misleading,
it simply means that evdev will use the relative axes. your problem is
that 0/0 coordinates are sent and we need to figure out why. do you see the
0/0 coordinates when you run evtest against the device? if so, then the
kernel driver needs fixing (or quirking). otherwise, it's either evdev or
the server.

Cheers,
  Peter
 
> The result is that a device which only has axes (no buttons) will be
> configured as a mouse.  This patch requires that the device have at
> least one button in order to be configured as a mouse.
> 
> This behavior was discovered when the Hercules DJ Console's MIDI port
> was being configured as a mouse.  This made the mouse unusable in X11
> because the MIDI port is constantly sending events that are
> interpreted as (0, 0) coordinates.
> 
> ---
>  src/evdev.c |   13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> Index: b/src/evdev.c
> ===================================================================
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -1946,21 +1946,28 @@
>      }
>  
>      if (has_rel_axes || has_abs_axes || num_buttons) {
> -        pInfo->flags |= XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS |
> -                        XI86_CONFIGURED;
> +	int accepted = 0;
>  	if (pEvdev->flags & EVDEV_TOUCHPAD) {
> +	    accepted = 1;
>  	    xf86Msg(X_INFO, "%s: Configuring as touchpad\n", pInfo->name);
>  	    pInfo->type_name = XI_TOUCHPAD;
>  	} else if (pEvdev->flags & EVDEV_TABLET) {
> +	    accepted = 1;
>  	    xf86Msg(X_INFO, "%s: Configuring as tablet\n", pInfo->name);
>  	    pInfo->type_name = XI_TABLET;
>          } else if (pEvdev->flags & EVDEV_TOUCHSCREEN) {
> +	    accepted = 1;
>              xf86Msg(X_INFO, "%s: Configuring as touchscreen\n", pInfo->name);
>              pInfo->type_name = XI_TOUCHSCREEN;
> -	} else {
> +	} else if (num_buttons) {
> +	    accepted = 1;
>  	    xf86Msg(X_INFO, "%s: Configuring as mouse\n", pInfo->name);
>  	    pInfo->type_name = XI_MOUSE;
>  	}
> +	if( accepted ) {
> +	    pInfo->flags |= XI86_POINTER_CAPABLE | XI86_SEND_DRAG_EVENTS |
> +		XI86_CONFIGURED;
> +	}
>      }
>  
>      if (has_keys) {




More information about the xorg mailing list