mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-07 00:28:58 +00:00
Expose method to inject PASTE on Device
This will allow a consistent implementation for injecting COPY.
This commit is contained in:
parent
09bb6a68cf
commit
0f6cdc56fa
2 changed files with 5 additions and 1 deletions
|
@ -237,7 +237,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()) {
|
||||
device.injectKeycode(KeyEvent.KEYCODE_PASTE);
|
||||
device.injectPasteKeycode();
|
||||
}
|
||||
|
||||
return ok;
|
||||
|
|
|
@ -186,6 +186,10 @@ public final class Device {
|
|||
return injectKeycode(keyCode, InputManager.INJECT_INPUT_EVENT_MODE_ASYNC);
|
||||
}
|
||||
|
||||
public boolean injectPasteKeycode() {
|
||||
return injectKeycode(KeyEvent.KEYCODE_PASTE);
|
||||
}
|
||||
|
||||
public boolean isScreenOn() {
|
||||
return serviceManager.getPowerManager().isScreenOn();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue