mirror of
https://github.com/Genymobile/scrcpy
synced 2025-08-31 22:35:37 +00:00
Add --no-key-repeat cli option
Add an option to avoid forwarding repeated key events. PR #1623 <https://github.com/Genymobile/scrcpy/pull/1623> Refs #1013 <https://github.com/Genymobile/scrcpy/issues/1013> Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
committed by
Romain Vimont
parent
65d06a3663
commit
84f1d9e375
@@ -58,6 +58,7 @@ input_manager_init(struct input_manager *im,
|
||||
const struct scrcpy_options *options)
|
||||
{
|
||||
im->control = options->control;
|
||||
im->forward_key_repeat = options->forward_key_repeat;
|
||||
im->prefer_text = options->prefer_text;
|
||||
|
||||
const struct sc_shortcut_mods *shortcut_mods = &options->shortcut_mods;
|
||||
@@ -461,6 +462,9 @@ input_manager_process_key(struct input_manager *im,
|
||||
}
|
||||
|
||||
if (event->repeat) {
|
||||
if (!im->forward_key_repeat) {
|
||||
return;
|
||||
}
|
||||
++im->repeat;
|
||||
} else {
|
||||
im->repeat = 0;
|
||||
|
Reference in New Issue
Block a user