mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Send touch events from the client
On SDL touch events, send control messages to the server.
This commit is contained in:
parent
f765aae352
commit
b5a2d99bc2
5 changed files with 52 additions and 0 deletions
|
|
@ -397,6 +397,17 @@ input_manager_process_mouse_motion(struct input_manager *input_manager,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
input_manager_process_touch(struct input_manager *input_manager,
|
||||
const SDL_TouchFingerEvent *event) {
|
||||
struct control_msg msg;
|
||||
if (convert_touch(event, input_manager->screen->frame_size, &msg)) {
|
||||
if (!controller_push_msg(input_manager->controller, &msg)) {
|
||||
LOGW("Could not request 'inject touch event'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
is_outside_device_screen(struct input_manager *input_manager, int x, int y)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue