2
0
mirror of https://github.com/Genymobile/scrcpy synced 2025-09-01 06:45:40 +00:00

Send touch events from the client

On SDL touch events, send control messages to the server.
This commit is contained in:
Romain Vimont
2019-09-22 21:30:05 +02:00
parent f765aae352
commit b5a2d99bc2
5 changed files with 52 additions and 0 deletions

View File

@@ -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)
{