Skip to content

Commit

Permalink
Split only at EV_SYN if we've seen x/y values
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten committed Oct 18, 2024
1 parent ed4fae8 commit d3f8f08
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions driver/usbmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ static unsigned int usb_mouse_events(struct input_handle *handle, struct input_v
state->wheel = v->value;
break;
}
} else if (v->type == EV_SYN && v->code == SYN_REPORT) {
/* If we find an EV_SYN event, we store the pointer and apply acceleration next */
} else if (
(state->x != NONE_EVENT_VALUE || state->y != NONE_EVENT_VALUE) &&
v->type == EV_SYN && v->code == SYN_REPORT
) {
/* If we find an EV_SYN event, and we've seen x/y values, we store the pointer and apply acceleration next */
v_syn = v;
break;
}
Expand Down

0 comments on commit d3f8f08

Please sign in to comment.