2
0
mirror of https://github.com/Genymobile/scrcpy synced 2025-09-02 23:35:19 +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

@@ -38,6 +38,17 @@ enum sc_keyboard_input_mode {
SC_KEYBOARD_INPUT_MODE_HID,
};
enum sc_key_inject_mode {
// Inject special keys, letters and space as key events.
// Inject numbers and punctuation as text events.
// This is the default mode.
SC_KEY_INJECT_MODE_MIXED,
// Inject special keys as key events.
// Inject letters and space, numbers and punctuation as text events.
SC_KEY_INJECT_MODE_TEXT,
};
#define SC_MAX_SHORTCUT_MODS 8
enum sc_shortcut_mod {
@@ -98,7 +109,7 @@ struct scrcpy_options {
bool control;
bool display;
bool turn_screen_off;
bool prefer_text;
enum sc_key_inject_mode key_inject_mode;
bool window_borderless;
bool mipmaps;
bool stay_awake;