Skip to content

Instantly share code, notes, and snippets.

@murano500k
Last active July 3, 2017 14:00
Show Gist options
  • Save murano500k/57893b87acd21c06c1f73c8a9b568eb4 to your computer and use it in GitHub Desktop.
Save murano500k/57893b87acd21c06c1f73c8a9b568eb4 to your computer and use it in GitHub Desktop.
https://source.android.com/devices/input/touch-devices#touch-device-configuration
My current /system/usr/idc/Vendor_dead_Product_beef.idc contains:
# Basic Parameters
touch.deviceType = touchScreen
touch.orientationAware = 1
# Touch Size
# Tool Size
touch.size.calibration = area
touch.size.scale = 28
touch.size.bias = 0
touch.size.isSummed = 0
fd_virtual_dev = open("/dev/uinput", O_WRONLY | O_NONBLOCK);
if (fd_virtual_dev < 0)
return die("error: open");
if (ioctl(fd_virtual_dev, UI_SET_EVBIT, EV_ABS) < 0)
return die("error: ioctl ev_abs");
if (ioctl(fd_virtual_dev, UI_SET_EVBIT, EV_SYN) < 0)
return die("error: ioctl ev_syn");
if (ioctl(fd_virtual_dev,UI_SET_ABSBIT,ABS_MT_TOUCH_M AJOR) < 0)
return die("error: ioctl ABS_MT_TOUCH_MAJOR");
if (ioctl(fd_virtual_dev,UI_SET_ABSBIT,ABS_MT_WIDTH_M AJOR) < 0)
return die("error: ioctl ABS_MT_TOUCH_MAJOR");
if (ioctl(fd_virtual_dev,UI_SET_ABSBIT,ABS_MT_POSITIO N_X) < 0)
return die("error: ioctl ABS_MT_POSITION_X");
if (ioctl(fd_virtual_dev,UI_SET_ABSBIT,ABS_MT_POSITIO N_Y) < 0)
return die("error: ioctl ABS_MT_POSITION_Y");
if (ioctl(fd_virtual_dev,UI_SET_ABSBIT,ABS_MT_TRACKIN G_ID) < 0)
return die("error: ioctl ABS_MT_TRACKING_ID");
if (ioctl(fd_virtual_dev,UI_SET_ABSBIT,ABS_MT_SLOT) < 0)
return die("error: ioctl");
if (ioctl(fd_virtual_dev,UI_SET_ABSBIT,ABS_MT_PRESSUR E) < 0)
return die("error: ioctl ABS_MT_PRESSURE");
memset(&uidev, 0, sizeof(uidev));
snprintf(uidev.name, UINPUT_MAX_NAME_SIZE, "uinput-device");
uidev.id.bustype = BUS_VIRTUAL;
uidev.id.vendor = 0x0;
uidev.id.product = 0x0;
uidev.id.version = 0;
uidev.absmax[ABS_MT_TOUCH_MAJOR] = 64;
uidev.absmax[ABS_MT_WIDTH_MAJOR] = 64;
uidev.absmax[ABS_MT_POSITION_X] = 1024;
uidev.absmax[ABS_MT_POSITION_Y] = 800;
uidev.absmax[ABS_MT_TRACKING_ID] = 65535;
uidev.absmax[ABS_MT_SLOT] = 9;
uidev.absmax[ABS_MT_PRESSURE] = 64;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment