evdev: eGalax Touchscreen.

Pat Suwalski pat at suwalski.net
Tue May 12 20:13:56 PDT 2009


Hello,

I have a few pieces of eGalax touchscreen hardware that seem to behave
differently with evdev.

First off, I noticed that calibration using the latest xinput tool
(1.4.1) doesn't work (this is X 1.6.1 with evdev 2.2.2 and today's git).

Should a touchpad respect the calibrations set by xinput? Looking for
calibration in evdev.c only shows it being used in the Wacom-ish section.

Secondly, the other touchscreen doesn't work at all. After fiddling
around for a while, it appears that the coordinates are supplied in
pEvdev->vals[] 2,3 rather than 0,1. Adding code in the EV_ABS case
(~line 400) like so:

   if (ev->code == 2)
     ev->code = ABS_X;
   if (ev->code == 3)
     ev->code = ABS_Y;

makes events click into place and work like the first touchscreen.

This output suggests that it's treated as a touchpad rather than a
touchscreen:

(**) eGalax Inc. USB TouchController: always reports core events
(**) eGalax Inc. USB TouchController: Device: "/dev/input/event8"
(II) eGalax Inc. USB TouchController: Found 2 mouse buttons
(II) eGalax Inc. USB TouchController: found absolute axes
(II) eGalax Inc. USB TouchController: Found x and y absolute axes
(II) eGalax Inc. USB TouchController: Found absolute touchpad
(II) eGalax Inc. USB TouchController: Configuring as touchpad
(**) eGalax Inc. USB TouchController: YAxisMapping: buttons 4 and 5
(**) eGalax Inc. USB TouchController: EmulateWheelButton: 4,
EmulateWheelInertia: 10, EmulateWheelTimeout: 200
(II) XINPUT: Adding extended input device "eGalax Inc. USB
TouchController" (type: TOUCHPAD)

The reason for this is that num_buttons is 3. Upon investigating
further, they are BTN_LEFT, BTN_RIGHT, and BTN_MIDDLE. I suspect it
might have something to do with the following in the usbtouchscreen.c
from the kernel:

         /* ignore the HID capable devices, handled by usbhid */
         {USB_DEVICE_HID_CLASS(0x0eef, 0x0001), .driver_info =
DEVTYPE_IGNORE},
         {USB_DEVICE_HID_CLASS(0x0eef, 0x0002), .driver_info =
DEVTYPE_IGNORE},

Possibly, if they are treating this device as plain HID, it
automatically gains buttons? The USB ID on both parts (which are
different) is 0x0eef:0x0001.

Here is the real kicker. If forced to go into the Wacom/calibration
block by commenting out:

     abs = 0;
     rel = 1;

at least one of the touchscreens is perfectly calibrated. The other no
longer has funny relative drag events.

I'm really looking for advice here, as it seems that more than one thing
is broken or at least contributing to problems. It would be really nice
to get touchscreens working a little better with evdev, and not have to
use evtouch. I'm not sure if my problems are related to kernel, X-evdev,
or something in between.

Cheers,
--Pat



More information about the xorg-devel mailing list