For convenience, forward RCtrl+c (or Cmd+c) and and RCtrl+x (or Cmd+x)
as LCtrl+c and LCtrl+x to the device.
This allows to use the "natural" keys for copy-paste (especially on
macOS).
RCtrl+v is the only scrcpy shortcut related to copy-paste. Since it's
not a real "paste", reformulate to indicate that it injects the
clipboard content as text events.
Now that content is pasted on Ctrl+v, the hack to send the PASTE keycode
(for Android >= 7 only) is obsolete. Remove it.
This reverts fc1dec027093ee8a2746a212db0c72a9d96d39a4.
Now that LCtrl+v synchronize the computer clipboard to the device
clipboard, RCtrl+Shift+v is not needed anymore.
Note: RCtrl+v is kept to send the computer clipboard content as a
sequence of keys.
Do not explicitly set the clipboard text if it already contains the
expected content. This avoids possible copy-paste loops between the
computer and the device.
Pressing Ctrl+v on the device will typically paste the clipboard
content.
Before sending the key event, synchronize the computer clipboard to the
device clipboard to allow seamless copy-paste.
The function must return a SDL_LogPriority, but returned an enum
sc_log_level.
(It was harmless because this specific return should never happen, as
asserted.)
This reverts commit 8c8649cfcd710859ce18eab557ed2af8cedb9a42.
I cannot reproduce the issue with Ctrl+Shift+o on any device, so in
practice it works, it's too bad to remove the feature for a random bug
on some Android versions on some devices.
In practice, it does not change anything (it just avoids a spurious
wake-up), but semantically, it makes no sense to call
pushClipboardText() with a null value.
Clean up has been broken by 3df63c579da7a35048458c6884f5f386154d2353.
The verbosity was correctly initialized for the Server process, but not
for the CleanUp process.
To avoid the problem, initialize a default log level.
Only the main injection method was exposed on Device, the convenience
methods were implemented in Controller.
For consistency, move them all to the Device class.
The Android device listens for clipboard changes to synchronize with the
computer clipboard.
However, if the change comes from scrcpy (for example via Ctrl+Shift+v),
do not notify the change.
Add a command-line option to force "adb forward", without attempting
"adb reverse" first.
This is especially useful for using SSH tunnels without enabling remote
port forwarding.
The verbosity was set either to info (in release mode) or debug (in
debug mode).
Add a command-line argument to change it, so that users can enable debug
logs using the release:
scrcpy -Vdebug
The field lock_video_orientation may only take values between -1 and 3
(included). But the compiler may trigger a warning on the sprintf()
call, because its type could represent values which could overflow the
string (like "-128"):
> warning: ‘%i’ directive writing between 1 and 4 bytes into a region of
> size 3 [-Wformat-overflow=]
Increase the buffer size to remove the warning.