11# OTG
22
33By default, _ scrcpy_ injects input events at the Android API level. As an
4- alternative, when connected over USB, it is possible to send HID events, so that
5- scrcpy behaves as if it was a physical keyboard and/or mouse connected to the
6- Android device.
4+ alternative, it is possible to send HID events, so that scrcpy behaves as if it
5+ was a [ physical keyboard] and/or a [ physical mouse] connected to the Android
6+ device (see [ keyboard ] ( keyboard.md ) and [ mouse ] ( mouse.md ) ) .
77
8- A special mode allows to control the device without mirroring, using AOA
9- [ keyboard] ( keyboard.md#aoa ) and [ mouse] ( mouse.md#aoa ) . Therefore, it is possible
10- to run _ scrcpy_ with only physical keyboard and mouse simulation (HID), as if
11- the computer keyboard and mouse were plugged directly to the device via an OTG
12- cable.
8+ [ physical keyboard ] : keyboard.md#physical-keyboard-simulation
9+ [ physical mouse ] : physical-keyboard-simulation
1310
14- In this mode, ` adb ` (USB debugging) is not necessary, and mirroring is disabled.
11+ A special mode (OTG) allows to control the device using AOA
12+ [ keyboard] ( keyboard.md#aoa ) and [ mouse] ( mouse.md#aoa ) , without using _ adb_ at
13+ all (so USB debugging is not necessary). In this mode, video and audio are
14+ disabled, and ` --keyboard=aoa and ` --mouse=aoa` are implicitly set.
1515
16- This is similar to ` --keyboard=aoa --mouse=aoa ` , but without mirroring.
16+ Therefore, it is possible to run _ scrcpy_ with only physical keyboard and mouse
17+ simulation, as if the computer keyboard and mouse were plugged directly to the
18+ device via an OTG cable.
1719
1820To enable OTG mode:
1921
@@ -23,7 +25,7 @@ scrcpy --otg
2325scrcpy --otg -s 0123456789abcdef
2426```
2527
26- It is possible to disable HID keyboard or HID mouse:
28+ It is possible to disable keyboard or mouse:
2729
2830``` bash
2931scrcpy --otg --keyboard=disabled
@@ -35,3 +37,22 @@ It only works if the device is connected over USB.
3537## OTG issues on Windows
3638
3739See [ FAQ] ( /FAQ.md#otg-issues-on-windows ) .
40+
41+
42+ ## Control-only
43+
44+ Note that the purpose of OTG is to control the device without USB debugging
45+ (adb).
46+
47+ If you want to solely control the device without mirroring while USB debugging
48+ is enabled, then OTG mode is not necessary.
49+
50+ Instead, disable video and audio, and select UHID (or AOA):
51+
52+ ``` bash
53+ scrcpy --no-video --no-audio --keyboard=uhid --mouse=uhid
54+ scrcpy --no-video --no-audio -KM # short version
55+ scrcpy --no-video --no-audio --keyboard=aoa --mouse=aoa
56+ ```
57+
58+ One benefit of UHID is that it also works wirelessly.
0 commit comments