Skip to content

Commit

Permalink
Check options specific to SDK keyboard
Browse files Browse the repository at this point in the history
Fail if an option specific to --keyboard=sdk is passed with another
keyboard input mode.

PR #4473 <#4473>
  • Loading branch information
rom1v committed Feb 29, 2024
1 parent 5f12132 commit dd479ed
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -2611,6 +2611,23 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
}
}

if (opts->keyboard_input_mode != SC_KEYBOARD_INPUT_MODE_SDK) {
if (opts->key_inject_mode == SC_KEY_INJECT_MODE_TEXT) {
LOGE("--prefer-text is specific to --keyboard=sdk");
return false;
}

if (opts->key_inject_mode == SC_KEY_INJECT_MODE_RAW) {
LOGE("--raw-key-events is specific to --keyboard=sdk");
return false;
}

if (!opts->forward_key_repeat) {
LOGE("--no-key-repeat is specific to --keyboard=sdk");
return false;
}
}

if ((opts->tunnel_host || opts->tunnel_port) && !opts->force_adb_forward) {
LOGI("Tunnel host/port is set, "
"--force-adb-forward automatically enabled.");
Expand Down

0 comments on commit dd479ed

Please sign in to comment.