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

Explicitly indicate when device clipboard is set

Pass the information that device clipboard has been set to the key
processor. This avoids the keyprocessor to "guess", and paves the way to
implement a proper acknowledgement mechanism.

PR #2814 <https://github.com/Genymobile/scrcpy/pull/2814>
This commit is contained in:
Romain Vimont
2021-11-21 17:24:34 +01:00
parent 854de9659a
commit 5b3856c3b6
4 changed files with 23 additions and 10 deletions

View File

@@ -510,7 +510,8 @@ input_manager_process_key(struct input_manager *im,
return;
}
if (ctrl && !shift && keycode == SDLK_v && down && !repeat) {
bool is_ctrl_v = ctrl && !shift && keycode == SDLK_v && down && !repeat;
if (is_ctrl_v) {
if (im->legacy_paste) {
// inject the text as input events
clipboard_paste(controller);
@@ -525,7 +526,7 @@ input_manager_process_key(struct input_manager *im,
}
}
im->kp->ops->process_key(im->kp, event);
im->kp->ops->process_key(im->kp, event, is_ctrl_v);
}
static void