Send touch event without pressure on button up

Refs #1518 <https://github.com/Genymobile/scrcpy/issues/1518>
This commit is contained in:
Romain Vimont 2020-07-07 19:37:52 +02:00
parent 5fa46ad0c7
commit deea29f52a

View file

@ -511,7 +511,8 @@ convert_mouse_button(const SDL_MouseButtonEvent *from, struct screen *screen,
to->inject_touch_event.position.screen_size = screen->frame_size;
to->inject_touch_event.position.point =
screen_convert_window_to_frame_coords(screen, from->x, from->y);
to->inject_touch_event.pressure = 1.f;
to->inject_touch_event.pressure =
from->type == SDL_MOUSEBUTTONDOWN ? 1.f : 0.f;
to->inject_touch_event.buttons =
convert_mouse_buttons(SDL_BUTTON(from->button));