Hello, I found that when some of my Android 7.1.2 phones use version 1.15.1, the Ctrl+V key combination does not have any effect.
When I use Ctrl+Shift+V on version 1.14, it can be pasted.
Ctrl+V key combination does not have any effect.
In which apps? What if you copy some text from the device (either with Ctrl+c or with long-press, then COPY) instead of from the computer, then Ctrl+v?
Since v1.15, Ctrl+v does 2 things:
The changes between v1.14 and v1.15 could be confusing. There are 3 ways to paste:
See https://github.com/Genymobile/scrcpy#copy-paste
When I use Ctrl+Shift+V on version 1.14
Does MOD+v work in v1.15?
I tested MOD + V, but there is no response on these Android 7.1.2 devices, but it can be pasted in version 1.14.
By the way, not all mobile phones will be like this, this problem only occurs on some Android 7.1.2 devices.
Using one of these Android 7.1.2 devices, copy some text on the computer (with Ctrl+c), copy some text on the device (long-press, COPY).
Then could you describe the result for each case:
On v1.14:
On v1.15.1:
With adb:
adb shell input keyevent PASTE: ?On v1.14:
Ctrl+v: Cannot paste non-ASCII characters
Ctrl+Shift+v: Can paste non-ASCII characters
On v1.15.1:
MOD+v: No response, the clipboard is not synchronized.
Ctrl+v: No response, the clipboard is not synchronized.
Ctrl+Shift+v: No response, the clipboard is not synchronized.
With adb:
adb shell input keyevent PASTE: Can paste non-ASCII characters
Ctrl+Shift+v: No response, the clipboard is not synchronized.
Sorry, I meant MOD+Shift+v.
MOD+Shift+v,cmd returns information:
[server] WARN: Could not inject char u+5378
[server] WARN: Could not inject char u+8f7d
[server] WARN: Could not inject char u+65e7
[server] WARN: Could not inject char u+7248
Without pasting any ASCII characters?
MOD+Shift+V can paste ASCII characters.
Could you please retest MOD+v and Ctrl+v on v1.15.1 + some more logs:
diff --git a/app/src/input_manager.c b/app/src/input_manager.c
index 1d73980c..14fe73d6 100644
--- a/app/src/input_manager.c
+++ b/app/src/input_manager.c
@@ -177,6 +177,7 @@ collapse_notification_panel(struct controller *controller) {
static void
set_device_clipboard(struct controller *controller, bool paste) {
char *text = SDL_GetClipboardText();
+ LOGI("Computer clipboard: \"%s\"", text);
if (!text) {
LOGW("Could not get clipboard text: %s", SDL_GetError());
return;
diff --git a/server/src/main/java/com/genymobile/scrcpy/Controller.java b/server/src/main/java/com/genymobile/scrcpy/Controller.java
index 9100a9db..af3fe86a 100644
--- a/server/src/main/java/com/genymobile/scrcpy/Controller.java
+++ b/server/src/main/java/com/genymobile/scrcpy/Controller.java
@@ -117,6 +117,7 @@ public class Controller {
}
break;
case ControlMessage.TYPE_SET_CLIPBOARD:
+ Ln.i("Set device clipboard (" + msg.getPaste() + "): \"" + msg.getText() + "\"");
setClipboard(msg.getText(), msg.getPaste());
break;
case ControlMessage.TYPE_SET_SCREEN_POWER_MODE:
@@ -263,6 +264,7 @@ public class Controller {
// On Android >= 7, also press the PASTE key if requested
if (paste && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && device.supportsInputEvents()) {
+ Ln.i("Injecting PASTE");
device.injectKeycode(KeyEvent.KEYCODE_PASTE);
}
diff --git a/server/src/main/java/com/genymobile/scrcpy/Device.java b/server/src/main/java/com/genymobile/scrcpy/Device.java
index de551f35..73a38296 100644
--- a/server/src/main/java/com/genymobile/scrcpy/Device.java
+++ b/server/src/main/java/com/genymobile/scrcpy/Device.java
@@ -224,6 +224,7 @@ public final class Device {
String currentClipboard = getClipboardText();
if (currentClipboard == null || currentClipboard.equals(text)) {
+ Ln.i("Clipboard already set, ignoring");
// The clipboard already contains the requested text.
// Since pasting text from the computer involves setting the device clipboard, it could be set twice on a copy-paste. This would cause
// the clipboard listeners to be notified twice, and that would flood the Android keyboard clipboard history. To workaround this
Here is a binary (replace it in you v1.15.1 release):
scrcpy-server_(if you are comfortable in applying diff and build to test, please tell me, it would avoid to generate a binary next time)_
Ctrl+V:
[server] INFO: Device: ZUK Z2 Plus (Android 7.1.2)
INFO: Renderer: direct3d
INFO: Initial texture: 1080x1920
[server] INFO: Set device clipboard (false): "1276425564@&^%$155"
[server] INFO: Clipboard already set, ignoring
MOD+V
[server] INFO: Device: ZUK Z2 Plus (Android 7.1.2)
INFO: Renderer: direct3d
INFO: Initial texture: 1080x1920
[server] INFO: Set device clipboard (true): "1276425564@&^%$155"
[server] INFO: Clipboard already set, ignoring
[server] INFO: Injecting PASTE
Neither method can paste this character into the device.
In fact, I really look forward to your perfect implementation of the Ctrl+V paste method.
Oh, got it! The condition was incorrect: 80a240cbd4657b7ffb67f69df01a4c104f0cfcb7
Could you please confirm that it fixes your problem?
scrcpy-serverThanks, it can be pasted normally!
Thank you so much, you can publish a fixed version!
Thank you for your report and tests :+1:
Merged in dev: 95f1ea0d80e6bb61579ae6c9a50554d235d91383
you can publish a fixed version!
Yes, the bug could require to publish v1.15.2, but I think that if everything is ok with the pinch-to-zoom implementation (https://github.com/Genymobile/scrcpy/issues/24#issuecomment-671063070), I will probably just publish v1.16 soon.
Very good, I am looking forward to it!
(If you have time, I'm interested in tests/feedbacks for the pinch-to-zoom feature :wink:)
Fixed in v1.16.
Most helpful comment
When I use Ctrl+Shift+V on version 1.14, it can be pasted.