Problem with HID Descriptors for Android USB Touch

I will try to describe my problem as clearly as possible. I am trying to get a touch device working with Android. the device is a USB device, and I work correctly in various OSs (Windows, Mac OS X, Ubuntu). In Android 4.0.4, I seem to have a problem. There is some touch reaction, but this is not true. the touch screen behaves like a touch panel, not an absolute touch screen, also, touches are not displayed correctly.

I looked at various HID descriptors and found the following that might cause a problem with Android:

  Interface 0 HID Report Descriptor Mouse
 Item Tag (Value) Raw Data
 Usage Page (Generic Desktop) 05 01 
 Usage (Mouse) 09 02 
 Collection (Application) A1 01 
     Usage (Pointer) 09 01 
     Collection (Physical) A1 00 
         Usage Page (Digitizer) 05 0D 
         Usage (Touch) 09 33 
         Usage Minimum (Digitizer) 19 01 
         Usage Maximum (Digitizer) 29 01 
         Logical Minimum (0) 15 00 
         Logical Maximum (1) 25 01 
         Report Count (1) 95 01 
         Report Size (1) 75 01 
         Input (Data, Var, Abs, NWrp, Lin, Pref, NNul, Bit) 81 02 
         Report Count (1) 95 01 
         Report Size (7) 75 07 
         Input (Cnst, Ary, Abs) 81 01 
         Usage Page (Generic Desktop) 05 01 
         Usage (X) 09 30 
         Usage (Y) 09 31 
         Logical Minimum (0) 15 00 
         Logical Maximum (1024) 26 00 04 
         Physical Minimum (16) 35 10 
         Physical Maximum (1024) 46 00 04 
         Unit (None) 65 00 
         Report Size (16) 75 10 
         Report Count (2) 95 02 
         Input (Data, Var, Abs, NWrp, Lin, NPrf, Null, Bit) 81 62 
     End collection c0 
 End collection

Now it looks like the device is reporting both a digitizer and a touch device? The device is a single point point-and-click device and reports the absolute coordinates of X and Y.

I wonder if the android got confused by reading this report, and as such it loads the digitizer / tablet configuration, and not the touch? There are several pointers here http://source.android.com/tech/input/touch-devices.html , but I do not understand where this data is communicated / defined?

Any help would be greatly appreciated. If necessary, I can send additional information from HID reports.

+4
source share
2 answers

Based on my analysis, I give this suggestion. Take the logical maximum coefficient to the physical maximum for X and Y.

factorValue = Logical Maximum / Maximum Physical

Multiply this factorValue with the raw coordinates that come from the touch screen and try sending to Android.

+2
source

In the general case, it is extremely important to use a mouse device that sends absolute coordinates. For example, on Linux this will not work due to errors and errors in X11.

Your descriptor is certainly wrong. You cannot mix mouse and digitizer.
These are two different categories of devices. The digitizer may be a touch screen or pen, but not a mouse. You risk that the driver does not know what to do with your device. Your handle is neither a fish nor a bird.

You mix different things: Use the Shared Desktop page using the Digitizer page.

To make sure of my project, I do not use a manual descriptor. I finally cloned a real touch screen from ELO Touchsystems. This works on all operating systems where I tested it. I can’t say if it works on Android.

But you can just try my handle: http://www.codeproject.com/Articles/1001891/A-USB-HID-Keyboard-Mouse-Touchscreen-emulator-with

+1
source

Source: https://habr.com/ru/post/1447213/


All Articles