mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-20 15:04:19 +01:00
Implement device-to-computer clipboard copy
On Ctrl+C: - the client sends a GET_CLIPBOARD command to the device; - the device retrieve its current clipboard text and sends it in a GET_CLIPBOARD device event; - the client sets this text as the system clipboard text, so that it can be pasted in another application. Fixes <https://github.com/Genymobile/scrcpy/issues/145>
This commit is contained in:
@@ -15,6 +15,7 @@ public final class ServiceManager {
|
||||
private InputManager inputManager;
|
||||
private PowerManager powerManager;
|
||||
private StatusBarManager statusBarManager;
|
||||
private ClipboardManager clipboardManager;
|
||||
|
||||
public ServiceManager() {
|
||||
try {
|
||||
@@ -68,4 +69,11 @@ public final class ServiceManager {
|
||||
}
|
||||
return statusBarManager;
|
||||
}
|
||||
|
||||
public ClipboardManager getClipboardManager() {
|
||||
if (clipboardManager == null) {
|
||||
clipboardManager = new ClipboardManager(getService("clipboard", "android.content.IClipboard"));
|
||||
}
|
||||
return clipboardManager;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user