Forbid HID input without OTG on Windows
On Windows, if the adb daemon is running, opening the USB device will necessarily fail, so HID input is not possible. Refs #2773 <https://github.com/Genymobile/scrcpy/issues/2773> PR #3011 <https://github.com/Genymobile/scrcpy/pull/3011>
This commit is contained in:
parent
25296ae167
commit
73a5311ac6
1 changed files with 12 additions and 0 deletions
|
@ -1680,6 +1680,18 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_USB
|
#ifdef HAVE_USB
|
||||||
|
|
||||||
|
# ifdef _WIN32
|
||||||
|
if (!opts->otg && (opts->keyboard_input_mode == SC_KEYBOARD_INPUT_MODE_HID
|
||||||
|
|| opts->mouse_input_mode == SC_MOUSE_INPUT_MODE_HID)) {
|
||||||
|
LOGE("On Windows, it is not possible to open a USB device already open "
|
||||||
|
"by another process (like adb).");
|
||||||
|
LOGE("Therefore, -K/--hid-keyboard and -M/--hid-mouse may only work in "
|
||||||
|
"OTG mode (--otg).");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
if (opts->otg) {
|
if (opts->otg) {
|
||||||
// OTG mode is compatible with only very few options.
|
// OTG mode is compatible with only very few options.
|
||||||
// Only report obvious errors.
|
// Only report obvious errors.
|
||||||
|
|
Loading…
Reference in a new issue