if (s->buttons_state == 0) {
packet->state = 0;
} else {
- if (s->buttons_state & MOUSE_EVENT_LBUTTON) {
- packet->state |= 1;
- }
- if (s->buttons_state & MOUSE_EVENT_RBUTTON) {
- packet->state |= 2;
- }
- if (s->buttons_state & MOUSE_EVENT_MBUTTON) {
- packet->state |= 4;
- }
+ packet->state = 1;
}
return EMUL_TOUCHSCREEN_PACKET_LEN;
pthread_mutex_unlock(&event_mutex);
+ memset(buf, 0, sizeof(buf) * (p->iov.size - 1));
ret = usb_touchscreen_poll(s, buf, p->iov.size); //write event to packet
usb_packet_copy(p, buf, ret);
break;