2
0
mirror of https://github.com/Genymobile/scrcpy synced 2025-08-30 22:05:12 +00:00

Use enum for key injection mode

There was only two key injection modes:
 - the default one
 - the mode with --prefer-text enabled

To prepare the addition of another mode (--raw-key-events), use an enum
instead of a bool.

PR #2831 <https://github.com/Genymobile/scrcpy/pull/2831>
This commit is contained in:
Romain Vimont
2021-11-26 22:05:28 +01:00
parent 0c0f62e4ab
commit 5e918ac0c3
6 changed files with 24 additions and 13 deletions

View File

@@ -1350,7 +1350,7 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
opts->push_target = optarg;
break;
case OPT_PREFER_TEXT:
opts->prefer_text = true;
opts->key_inject_mode = SC_KEY_INJECT_MODE_TEXT;
break;
case OPT_ROTATION:
if (!parse_rotation(optarg, &opts->rotation)) {