title: Android Touchscreen IDC
body: <p>I'm struggling with calibration of a touchscreen on Android plataform.</p>
  <p>It is an USB Single-Touch Touchscreen from vendor <code>0dfc</code> and product <code>0001</code> as checked with <code>dmesg</code>:</p>
  <pre><code>&lt;6&gt;[ 4118.091541] input: USB Touchscreen 0dfc:0001 as /devices/platform/usb20_host/usb2/2-1/2-1.3/2-1.3:1.0/input/input23
  </code></pre>
  <p>I'm pushing the <code>Vendor_0dfc_Product_0001.idc</code> file <code>/data/system/devices/idc/</code> (following the documentation from <a href="https://source.android.com/devices/tech/input/input-device-configuration-files.html" rel="nofollow noreferrer">android source - IDC</a></p>
  <p>I got the touch device with all requirements for single touch events:</p>
  <pre><code>root@android:/ # getevent -il /dev/input/event3                                
  add device 1: /dev/input/event3
    bus:      0003
    vendor    0dfc
    product   0001
    version   0202
    name:     &quot;USB Touchscreen 0dfc:0001&quot;
    location: &quot;usb-usb20_host-1.3/input0&quot;
    id:       &quot;&quot;
    version:  1.0.1
    events:
      KEY (0001): BTN_TOUCH            
      ABS (0003): ABS_X                 : value 540, min 0, max 32767, fuzz 0, flat 0, resolution 0
                  ABS_Y                 : value 289, min 0, max 32767, fuzz 0, flat 0, resolution 0
    input props:
      &lt;none&gt;
  </code></pre>
  <p>I also enabled the <code>Pointer Location</code> option from <code>Developer options</code> (Android settings) in order to debug this stage of calibration.</p>
  <p><strong>Setup 1</strong></p>
  <pre><code>touch.deviceType = touchScreen
  </code></pre>
  <p>With this setup (<strong>1</strong>) all the gestures on the touchscreen take place <strong>at the up-left corner</strong> - just a few pixels left/right/up/down no matter the gesture (swipe). All the touchscreen get events. All the gestures are reversed - when swipe left the pointer goes right; when swipe up, the pointer goes down.</p>
  <p><strong>Setup 2</strong></p>
  <pre><code>touch.deviceType = pointer
  touch.gestureMode = pointer
  </code></pre>
  <p>With this setup (<strong>2</strong>), as expected, it shows a pointer, placed at the position from the last pointer device left (mouse). All the gestures on the touchscreen (no matter the swipe size) keep beaving like setup <strong>1</strong> - move only a few pixels with each swipe event, and with reversed axis.</p>
  <p><strong>Setup 3</strong></p>
  <pre><code>touch.deviceType = pointer
  touch.gestureMode = spots
  </code></pre>
  <p>With this setup (<strong>3</strong>) the result is the same as setup <strong>2</strong>. I just did that to prove that the IDC file is being interpreted correctly.</p>
  <p>At this stage, as you can check by now, I have a <strong>working</strong> IDC file (<strong>setup 1</strong>) <strong>requiring calibration</strong> for this touch device.</p>
  <p>I tried a lot of combinations from other IDC files (internet samples) and from <a href="https://source.android.com/devices/tech/input/input-device-configuration-files.html" rel="nofollow noreferrer">android source - IDC</a> - <strong>ANY OTHER PROPERTY TOOK EFFECT (NOT A SINGLE ONE)</strong> - <code>raw.*</code>, <code>output.*</code>, <code>touch.size.*</code></p>
  <p>Does anyone knows how to calibrate properly a touch screen in Android that could guide me in this process?</p>