Toggle "raw key events" via shortcut

The "raw key events" mode may need to be toggled while scrcpy is
running (e.g. to type text then play a game).

Remove the command-line argument and bind Ctrl+k to toggle the mode.
This commit is contained in:
Romain Vimont 2018-08-15 21:07:50 +02:00
parent 9de332bbe5
commit 7cd1e39766
5 changed files with 21 additions and 42 deletions

View file

@ -220,6 +220,13 @@ void input_manager_process_key(struct input_manager *input_manager,
switch_fps_counter_state(input_manager->frames);
}
return;
case SDLK_k:
if (!repeat && event->type == SDL_KEYDOWN) {
input_manager->raw_key_events ^= SDL_TRUE; // toggle
LOGI("Raw key events mode %s",
input_manager->raw_key_events ? "enabled" : "disabled");
}
return;
}
return;