Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 929987 - Fix orangutan on first boot for inari;r=davehunt
Browse files Browse the repository at this point in the history
It seems like some devices (e.g. the inari) need a BTN_TOUCH event to "wake
up" the screen before they will start accepting input.
  • Loading branch information
wlach committed Oct 23, 2013
1 parent 15b5c06 commit d2a1bc1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions orng.c
Expand Up @@ -48,8 +48,10 @@ enum {
INPUT_DEVICE_CLASS_TOUCH_MT = 0x00000010,

/* The input device is a multi-touch touchscreen and needs MT_SYNC. */
INPUT_DEVICE_CLASS_TOUCH_MT_SYNC = 0x00000200
INPUT_DEVICE_CLASS_TOUCH_MT_SYNC = 0x00000200,

/* The device may need an initial BTN_DOWN event to "wake up" */
INPUT_DEVICE_CLASS_NEEDS_BTN_DOWN_WAKEUP = 0x00001000
};

static int global_tracking_id = 1;
Expand Down Expand Up @@ -384,7 +386,12 @@ uint32_t figure_out_events_device_reports(int fd) {
strcmp(device_name, "elan-touchscreen") == 0) {
device_classes |= INPUT_DEVICE_CLASS_TOUCH_MT_SYNC;
}
//}

// some devices need an initial btn down event to "wake up"
if (strcmp(device_name, "cyttsp-i2c") == 0) {
device_classes |= INPUT_DEVICE_CLASS_NEEDS_BTN_DOWN_WAKEUP;
}

// Is this an old style single-touch driver?
} else if ((test_bit(BTN_TOUCH, key_bitmask)
&& test_bit(ABS_X, abs_bitmask)
Expand Down Expand Up @@ -461,6 +468,10 @@ int main(int argc, char *argv[])

uint32_t device_flags = figure_out_events_device_reports(fd);

if (device_flags & INPUT_DEVICE_CLASS_NEEDS_BTN_DOWN_WAKEUP) {
write_event(fd, EV_KEY, BTN_TOUCH, 1);
}

FILE *f = fopen(script_file, "r");
if (!f) {
printf("Unable to read file %s", argv[1]);
Expand Down

0 comments on commit d2a1bc1

Please sign in to comment.