Hello,

On Wed, Dec 29, 2010 at 2:51 AM, Peter Hutterer
<[email protected]> 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) {

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) {
_______________________________________________
[email protected]: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.freedesktop.org/mailman/listinfo/xorg
Your subscription address: [email protected]

Reply via email to