mirror of
https://github.com/Genymobile/scrcpy
synced 2025-09-01 14:55:13 +00:00
Add option to disable clipboard autosync
By default, scrcpy automatically synchronizes the computer clipboard to the device clipboard before injecting Ctrl+v, and the device clipboard to the computer clipboard whenever it changes. This new option --no-clipboard-autosync disables this automatic synchronization. Fixes #2228 <https://github.com/Genymobile/scrcpy/issues/2228> PR #2817 <https://github.com/Genymobile/scrcpy/pull/2817>
This commit is contained in:
@@ -66,6 +66,7 @@ input_manager_init(struct input_manager *im, struct controller *controller,
|
||||
im->control = options->control;
|
||||
im->forward_all_clicks = options->forward_all_clicks;
|
||||
im->legacy_paste = options->legacy_paste;
|
||||
im->clipboard_autosync = options->clipboard_autosync;
|
||||
|
||||
const struct sc_shortcut_mods *shortcut_mods = &options->shortcut_mods;
|
||||
assert(shortcut_mods->count);
|
||||
@@ -518,7 +519,7 @@ input_manager_process_key(struct input_manager *im,
|
||||
|
||||
uint64_t ack_to_wait = SC_SEQUENCE_INVALID;
|
||||
bool is_ctrl_v = ctrl && !shift && keycode == SDLK_v && down && !repeat;
|
||||
if (is_ctrl_v) {
|
||||
if (im->clipboard_autosync && is_ctrl_v) {
|
||||
if (im->legacy_paste) {
|
||||
// inject the text as input events
|
||||
clipboard_paste(controller);
|
||||
|
Reference in New Issue
Block a user