diff --git a/app/src/cli.c b/app/src/cli.c index 94d3e5d4..057eb140 100644 --- a/app/src/cli.c +++ b/app/src/cli.c @@ -2603,6 +2603,12 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[], LOGE("In OTG mode, --mouse only supports aoa or disabled."); return false; } + + if (kmode == SC_KEYBOARD_INPUT_MODE_DISABLED + && mmode == SC_MOUSE_INPUT_MODE_DISABLED) { + LOGE("Could not disable both keyboard and mouse in OTG mode."); + return false; + } } if (opts->keyboard_input_mode != SC_KEYBOARD_INPUT_MODE_SDK) { diff --git a/app/src/usb/scrcpy_otg.c b/app/src/usb/scrcpy_otg.c index 2192fade..c1d38da3 100644 --- a/app/src/usb/scrcpy_otg.c +++ b/app/src/usb/scrcpy_otg.c @@ -127,12 +127,6 @@ scrcpy_otg(struct scrcpy_options *options) { bool enable_mouse = options->mouse_input_mode == SC_MOUSE_INPUT_MODE_AOA; - // If neither --hid-keyboard or --hid-mouse is passed, enable both - if (!enable_keyboard && !enable_mouse) { - enable_keyboard = true; - enable_mouse = true; - } - if (enable_keyboard) { ok = sc_keyboard_aoa_init(&s->keyboard, &s->aoa); if (!ok) {