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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user