Skip to content

Commit

Permalink
input-raw: set 0 pressure if ABS_MT_TOUCH_MAJOR is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
merge committed Oct 15, 2018
1 parent 5ce512d commit e73b6d1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/input-evdev-raw.c
Expand Up @@ -517,6 +517,10 @@ static int ts_input_read(struct tslib_module_info *inf,
case ABS_MT_PRESSURE:
i->current_p = ev.value;
break;
case ABS_MT_TOUCH_MAJOR:
if (ev.value == 0)
i->current_p = 0;
break;
case ABS_MT_TRACKING_ID:
if (ev.value == -1)
i->current_p = 0;
Expand Down Expand Up @@ -795,6 +799,8 @@ static int ts_input_read_mt(struct tslib_module_info *inf,
i->buf[total][i->slot].touch_major = ev.value;
i->buf[total][i->slot].tv = ev.time;
i->buf[total][i->slot].valid |= TSLIB_MT_VALID;
if (i->ev[it].value == 0)
i->buf[total][i->slot].pressure = 0;
break;
case ABS_MT_WIDTH_MAJOR:
i->buf[total][i->slot].width_major = ev.value;
Expand Down
6 changes: 6 additions & 0 deletions plugins/input-raw.c
Expand Up @@ -444,6 +444,10 @@ static int ts_input_read(struct tslib_module_info *inf,
case ABS_MT_PRESSURE:
i->current_p = ev.value;
break;
case ABS_MT_TOUCH_MAJOR:
if (ev.value == 0)
i->current_p = 0;
break;
case ABS_MT_TRACKING_ID:
if (ev.value == -1)
i->current_p = 0;
Expand Down Expand Up @@ -794,6 +798,8 @@ static int ts_input_read_mt(struct tslib_module_info *inf,
i->buf[total][i->slot].touch_major = i->ev[it].value;
i->buf[total][i->slot].tv = i->ev[it].time;
i->buf[total][i->slot].valid |= TSLIB_MT_VALID;
if (i->ev[it].value == 0)
i->buf[total][i->slot].pressure = 0;
break;
case ABS_MT_WIDTH_MAJOR:
i->buf[total][i->slot].width_major = i->ev[it].value;
Expand Down

0 comments on commit e73b6d1

Please sign in to comment.