diff --git a/server/src/main/java/com/genymobile/scrcpy/Controller.java b/server/src/main/java/com/genymobile/scrcpy/Controller.java index 6a6e1e59..8b956c0e 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Controller.java +++ b/server/src/main/java/com/genymobile/scrcpy/Controller.java @@ -374,7 +374,7 @@ public class Controller implements AsyncProcessor { private void getClipboard(int copyKey) { // On Android >= 7, press the COPY or CUT key if requested if (copyKey != ControlMessage.COPY_KEY_NONE && Build.VERSION.SDK_INT >= 24 && device.supportsInputEvents()) { - int key = copyKey == ControlMessage.COPY_KEY_COPY ? KeyEvent.KEYCODE_COPY : KeyEvent.KEYCODE_CUT; + int key = copyKey == ControlMessage.COPY_KEY_COPY ? 278 : 277; // Wait until the event is finished, to ensure that the clipboard text we read just after is the correct one device.pressReleaseKeycode(key, Device.INJECT_MODE_WAIT_FOR_FINISH); } @@ -398,7 +398,7 @@ public class Controller implements AsyncProcessor { // On Android >= 7, also press the PASTE key if requested if (paste && Build.VERSION.SDK_INT >= 24 && device.supportsInputEvents()) { - device.pressReleaseKeycode(KeyEvent.KEYCODE_PASTE, Device.INJECT_MODE_ASYNC); + device.pressReleaseKeycode(279, Device.INJECT_MODE_ASYNC); } if (sequence != ControlMessage.SEQUENCE_INVALID) {