Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to disable clipboard autosync #2817

Merged
merged 1 commit into from
Nov 24, 2021
Merged

Add option to disable clipboard autosync #2817

merged 1 commit into from
Nov 24, 2021

Conversation

rom1v
Copy link
Collaborator

@rom1v rom1v commented Nov 22, 2021

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

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 <#2228>
PR #2817 <#2817>
@rom1v rom1v changed the base branch from acksync to dev November 24, 2021 08:47
@rom1v rom1v merged commit 6abff46 into dev Nov 24, 2021
@Helaer
Copy link

Helaer commented Nov 29, 2021

默认情况下,scrcpy 在注入 Ctrl+v 之前会自动将计算机剪贴板同步到设备剪贴板,并在它发生变化时将设备剪贴板同步到计算机剪贴板。

此新选项--no-clipboard-autosync禁用此自动同步。

修复#2228

@rom1v After the --no-clipboard-autosync option is enabled, the clipboard will no longer be injected when using Ctrl+V to paste, and the windows clipboard cannot be pasted to Android, which is not a good experience.

@rom1v
Copy link
Collaborator Author

rom1v commented Nov 29, 2021

@Helaer When pressing Ctrl+v, scrcpy injects Ctrl and v do the device, it does not request to "paste" (it's the Android decision to bind the paste action if Ctrl+v is pressed).

In v1.14 and v1.15, mechanisms have been added to allow "seamless copy paste". In particular, this involves computer-to-device clipboard synchronization when Ctrl+v is pressed. And automatic synchronization any time the device clipboard is set.

This option aims to disable these mechanism, so Ctrl+v only injects Ctrl+v without synchronizing from the computer clipboard beforehand (so it typically pastes the device clipboard) Ctrl+c copies locally to the device.

However, MOD+v still injects PASTE after synchronization, so it is still possible to paste from computer to clipboard.
What's missing is that MOD+c (or MOD+x) do not synchronize before injecting COPY or CUT, but it's a bit more complicated. Will maybe add them in the future.

@Helaer
Copy link

Helaer commented Nov 29, 2021

@Helaer当按下 Ctrl+v 时,scrcpy 注入 Ctrl 并 v 执行设备,它不会请求“粘贴”(如果按下 Ctrl+v,这是 Android 决定绑定粘贴操作)。

在 v1.14 和 v1.15 中,添加了允许“无缝复制粘贴”的机制。特别是,这涉及按下 Ctrl+v 时计算机到设备剪贴板的同步。并在设置设备剪贴板时自动同步。

此选项旨在禁用这些机制,因此 Ctrl+v 仅注入 Ctrl+v,而无需事先从计算机剪贴板同步(因此它通常会粘贴设备剪贴板) Ctrl+c 本地复制到设备。

但是PASTE同步后MOD+v还是会注入的,所以还是可以从电脑粘贴到剪贴板的。 缺少的是 MOD+c(或 MOD+x)在注入COPYor之前不同步CUT,但它有点复杂。也许以后会添加它们。

Ok, I see.

rom1v added a commit that referenced this pull request Nov 29, 2021
If --no-clipboard-autosync is enabled, the automatic clipboard
synchronization whenever the device clipboard changes is disabled.

But on explicit copy and cut scrcpy shortcuts (MOD+c and MOD+x), the
clipboard should be synchronized, so that it is still possible to
copy-paste from the device to the computer.

This is consistent with the behavior of MOD+v, which pastes the computer
clipboard to the device.

Refs #2817 <#2817>
rom1v added a commit that referenced this pull request Nov 29, 2021
If --no-clipboard-autosync is enabled, the automatic clipboard
synchronization whenever the device clipboard changes is disabled.

But on explicit copy and cut scrcpy shortcuts (MOD+c and MOD+x), the
clipboard should be synchronized, so that it is still possible to
copy-paste from the device to the computer.

This is consistent with the behavior of MOD+v, which pastes the computer
clipboard to the device.

Refs #2228 <#2228>
Refs #2817 <#2817>
rom1v added a commit that referenced this pull request Nov 29, 2021
If --no-clipboard-autosync is enabled, the automatic clipboard
synchronization whenever the device clipboard changes is disabled.

But on explicit COPY and CUT scrcpy shortcuts (MOD+c and MOD+x), the
clipboard should still be synchronized, so that it remains possible to
copy-paste from the device to the computer.

This is consistent with the behavior of MOD+v, which pastes the computer
clipboard to the device.

Refs #2228 <#2228>
Refs #2817 <#2817>
@rom1v
Copy link
Collaborator Author

rom1v commented Nov 29, 2021

What's missing is that MOD+c (or MOD+x) do not synchronize before injecting COPY or CUT, but it's a bit more complicated. Will maybe add them in the future.

The future is now: #2834

rom1v added a commit that referenced this pull request Nov 29, 2021
If --no-clipboard-autosync is enabled, the automatic clipboard
synchronization performed whenever the device clipboard changes is
disabled.

But on explicit COPY and CUT scrcpy shortcuts (MOD+c and MOD+x), the
clipboard should still be synchronized, so that it remains possible to
copy-paste from the device to the computer.

This is consistent with the behavior of MOD+v, which pastes the computer
clipboard to the device.

Refs #2228 <#2228>
Refs #2817 <#2817>
PR #2834 <#2834>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants