Skip to content

Latest commit

 

History

History
130 lines (85 loc) · 3.94 KB

control.md

File metadata and controls

130 lines (85 loc) · 3.94 KB

Control

Read-only

To disable controls (everything which can interact with the device: input keys, mouse events, drag&drop files):

scrcpy --no-control
scrcpy -n   # short version

Keyboard and mouse

Read keyboard and mouse.

Control only

To control the device without mirroring:

scrcpy --no-video --no-audio

By default, mouse mode is switched to UHID if video mirroring is disabled (a relative mouse mode is required).

To also use a UHID keyboard, set it explicitly:

scrcpy --no-video --no-audio --keyboard=uhid
scrcpy --no-video --no-audio -K  # short version

To use AOA instead (over USB only):

scrcpy --no-video --no-audio --keyboard=aoa --mouse=aoa

Copy-paste

Any time the Android clipboard changes, it is automatically synchronized to the computer clipboard.

Any Ctrl shortcut is forwarded to the device. In particular:

  • Ctrl+c typically copies
  • Ctrl+x typically cuts
  • Ctrl+v typically pastes (after computer-to-device clipboard synchronization)

This typically works as you expect.

The actual behavior depends on the active application though. For example, Termux sends SIGINT on Ctrl+c instead, and K-9 Mail composes a new message.

To copy, cut and paste in such cases (but only supported on Android >= 7):

  • MOD+c injects COPY
  • MOD+x injects CUT
  • MOD+v injects PASTE (after computer-to-device clipboard synchronization)

In addition, MOD+Shift+v injects the computer clipboard text as a sequence of key events. This is useful when the component does not accept text pasting (for example in Termux), but it can break non-ASCII content.

WARNING: Pasting the computer clipboard to the device (either via Ctrl+v or MOD+v) copies the content into the Android clipboard. As a consequence, any Android application could read its content. You should avoid pasting sensitive content (like passwords) that way.

Some Android devices do not behave as expected when setting the device clipboard programmatically. An option --legacy-paste is provided to change the behavior of Ctrl+v and MOD+v so that they also inject the computer clipboard text as a sequence of key events (the same way as MOD+Shift+v).

To disable automatic clipboard synchronization, use --no-clipboard-autosync.

Pinch-to-zoom, rotate and tilt simulation

To simulate "pinch-to-zoom": Ctrl+click-and-move.

More precisely, hold down Ctrl while pressing the left-click button. Until the left-click button is released, all mouse movements scale and rotate the content (if supported by the app) relative to the center of the screen.

ctrl.mp4

To simulate a tilt gesture: Shift+click-and-move-up-or-down.

shift.mp4

Technically, scrcpy generates additional touch events from a "virtual finger" at a location inverted through the center of the screen. When pressing Ctrl the x and y coordinates are inverted. Using Shift only inverts x.

This only works for the default mouse mode (--mouse=sdk).

File drop

Install APK

To install an APK, drag & drop an APK file (ending with .apk) to the scrcpy window.

There is no visual feedback, a log is printed to the console.

Push file to device

To push a file to /sdcard/Download/ on the device, drag & drop a (non-APK) file to the scrcpy window.

There is no visual feedback, a log is printed to the console.

The target directory can be changed on start:

scrcpy --push-target=/sdcard/Movies/