Enable controls for camera video source

This will allow the implementation of camera-specific shortcuts.

Co-authored-by: Tommie <teh420@gmail.com>
This commit is contained in:
Romain Vimont
2025-11-02 14:47:40 +01:00
parent 6923ee6870
commit ac26cac4f7
7 changed files with 138 additions and 97 deletions

View File

@@ -2928,7 +2928,7 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
}
#endif
if (opts->control) {
if (opts->control && opts->video_source == SC_VIDEO_SOURCE_DISPLAY) {
if (opts->keyboard_input_mode == SC_KEYBOARD_INPUT_MODE_AUTO) {
opts->keyboard_input_mode = otg ? SC_KEYBOARD_INPUT_MODE_AOA
: SC_KEYBOARD_INPUT_MODE_SDK;
@@ -3106,8 +3106,10 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
}
if (opts->control) {
LOGI("Camera video source: control disabled");
opts->control = false;
// Disable all inputs for camera
opts->keyboard_input_mode = SC_KEYBOARD_INPUT_MODE_DISABLED;
opts->mouse_input_mode = SC_MOUSE_INPUT_MODE_DISABLED;
opts->gamepad_input_mode = SC_GAMEPAD_INPUT_MODE_DISABLED;
}
} else if (opts->camera_id
|| opts->camera_ar