By default, only the left click is forwarded to the device, and
secondary clicks trigger shortcuts (the behavior can be configured by
--mouse-bind=xxxx).
But when the mouse mode is relative (AOA and UHID modes), forward all
clicks by default. This makes more sense since the cursor is handled on
the device side, the user expects all mouse buttons to be forwarded.
Refs <https://github.com/Genymobile/scrcpy/issues/4727#issuecomment-2069869750>
PR #5022 <https://github.com/Genymobile/scrcpy/pull/5022>
Add a new option --mouse-bind=xxxx.
The argument must be exactly 4 characters, one for each secondary click:
--mouse-bind=xxxx
^^^^
||||
||| `- 5th click
|| `-- 4th click
| `--- middle click
`---- right click
Each character must be one of the following:
- `+`: forward the click to the device
- `-`: ignore the click
- `b`: trigger shortcut BACK (or turn screen on if off)
- `h`: trigger shortcut HOME
- `s`: trigger shortcut APP_SWITCH
- `n`: trigger shortcut "expand notification panel"
This deprecates --forward-all-clicks (use --mouse-bind=++++ instead).
Refs <https://github.com/Genymobile/scrcpy/pull/2258#issuecomment-2182394460>
PR #5022 <https://github.com/Genymobile/scrcpy/pull/5022>
To resize the window to fit the device screen, it is possible to
double-click in the "black bars".
This feature was mistakenly disabled when --forward-all-clicks was set.
Instead, disable it only if mouse relative mode is enabled (AOA or
UHID), because in that case the mouse cursor is on the device.
Restrict shortcut modifiers to be composed of only one item each.
Before, it was possible to select a list of multiple combinations of
modifier keys, like --shortcut-mod='lctrl+lalt,rctrl+rsuper', meaning
that shortcuts would be triggered either by LCtrl+LAlt+key or
RCtrl+RSuper+key.
This was overly generic, probably not used very much, and it prevents to
solve inconsistencies between UP and DOWN events of modifier keys sent
to the device.
Refs #4732 <https://github.com/Genymobile/scrcpy/issues/4732>
PR #4741 <https://github.com/Genymobile/scrcpy/pull/4741>
Do not call sc_screen_hide_window() if screen is not initialized.
To reproduce:
scrcpy --no-video --record=file.mp4
This only segfaults in debug mode since commit
fd0f432e87.
The project has 3 build dependencies:
- SDL
- FFmpeg
- libusb
For Windows, the release script downloaded pre-built build dependencies
(either from upstream, or from the scrcpy-deps repository).
Instead, download the source releases and build locally. This offers
more flexibility.
The official adb release is still downloaded and included as is in the
release archive (it is not a build dependency).
Also upgrade FFmpeg to 6.1.1 and libusb to 1.0.27.
PR #4713 <https://github.com/Genymobile/scrcpy/pull/4713>
Initially, if AOA initialization failed, default injection method was
used, in order to use the same command/shortcut when the device is
connected via USB or via TCP/IP, without changing the arguments.
Now that there are 3 keyboard modes, it seems unexpected to switch to
another specific mode if AOA fails (and it is inconsistent). If the user
explicitly requests AOA, then use AOA or fail.
Refs #2632 comment <https://github.com/Genymobile/scrcpy/pull/2632#issuecomment-945190859>
PR #4473 <https://github.com/Genymobile/scrcpy/pull/4473>
The options were deprecated, but for convenience, reassign them to
aliases for --keyboard=uhid and --mouse=uhid respectively.
Their long version (--hid-keyboard and --hid-mouse) remain deprecated.
PR #4473 <https://github.com/Genymobile/scrcpy/pull/4473>
The keyboard settings can be opened by:
adb shell am start -a android.settings.HARD_KEYBOARD_SETTINGS
Add a shortcut (MOD+k) for convenience if the current keyboard is HID.
PR #4473 <https://github.com/Genymobile/scrcpy/pull/4473>
There is a dependency cycle in the initialization order:
- keyboard depends on controller
- controller depends on acksync
- acksync depends on keyboard initialization
To break this cycle, bind the async instance to the controller in a
second step.
PR #4473 <https://github.com/Genymobile/scrcpy/pull/4473>
Rename {keyboard,mouse}_inject to {keyboard,mouse}_sdk.
All implementations "inject" key events and mouse events, what differs
is the mechanism. For these implementations, the Android SDK API is used
to inject events.
Note that the input mode enum variants were already renamed
(SC_KEYBOARD_INPUT_MODE_SDK and SC_MOUSE_INPUT_MODE_SDK).
PR #4473 <https://github.com/Genymobile/scrcpy/pull/4473>
An event contained several fields:
- the accessory id
- the HID event data
- a field ack_to_wait specific to the AOA implementation.
Extract the HID event part to prepare the factorization of HID event
creation.
PR #4473 <https://github.com/Genymobile/scrcpy/pull/4473>
Until now, there was two modes for keyboard and mouse:
- event injection using the Android system API (default)
- HID/AOA over USB
For this reason, the options were exposed as simple flags:
- -K or --hid-keyboard to enable physical keyboard simulation (AOA)
- -M or --hid-mouse to enable physical mouse simulation (AOA)
Replace them by explicit --keyboard and --mouse options, with 3 possible
values:
- disabled
- sdk (default)
- aoa
This will allow to add a new mode (uhid).
PR #4473 <https://github.com/Genymobile/scrcpy/pull/4473>
Co-authored-by: Romain Vimont <rom@rom1v.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
The input manager assumed that if a controller was present, then both a
key processor and a mouse processor were present.
Remove this assumption, to support disabling keyboard and mouse
separately. This prepares the introduction of new command line options
--keyboard and --mouse.
PR #4473 <https://github.com/Genymobile/scrcpy/pull/4473>