mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Handle repeating keycodes
Initialize "repeat" count on key events. PR #1519 <https://github.com/Genymobile/scrcpy/pull/1519> Refs #1013 <https://github.com/Genymobile/scrcpy/pull/1013> Signed-off-by: Romain Vimont <rom@rom1v.com>
This commit is contained in:
parent
0ba74fbd9a
commit
3c1ed5d86c
10 changed files with 45 additions and 11 deletions
|
|
@ -74,7 +74,7 @@ public class Controller {
|
|||
switch (msg.getType()) {
|
||||
case ControlMessage.TYPE_INJECT_KEYCODE:
|
||||
if (device.supportsInputEvents()) {
|
||||
injectKeycode(msg.getAction(), msg.getKeycode(), msg.getMetaState());
|
||||
injectKeycode(msg.getAction(), msg.getKeycode(), msg.getRepeat(), msg.getMetaState());
|
||||
}
|
||||
break;
|
||||
case ControlMessage.TYPE_INJECT_TEXT:
|
||||
|
|
@ -130,8 +130,8 @@ public class Controller {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean injectKeycode(int action, int keycode, int metaState) {
|
||||
return device.injectKeyEvent(action, keycode, 0, metaState);
|
||||
private boolean injectKeycode(int action, int keycode, int repeat, int metaState) {
|
||||
return device.injectKeyEvent(action, keycode, repeat, metaState);
|
||||
}
|
||||
|
||||
private boolean injectChar(char c) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue