mirror of
https://github.com/Genymobile/scrcpy
synced 2025-03-02 11:21:48 +00:00
Return success count in injectText
It will insert as many text as possible now. Fix #509, tested on Windows 10 and Arch Linux. Signed-off-by: Yu-Chen Lin <npes87184@gmail.com>
This commit is contained in:
parent
c8338b2918
commit
1630f923ef
@ -104,13 +104,15 @@ public class EventController {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean injectText(String text) {
|
private int injectText(String text) {
|
||||||
|
int successCount = 0;
|
||||||
for (char c : text.toCharArray()) {
|
for (char c : text.toCharArray()) {
|
||||||
if (!injectChar(c)) {
|
if (!injectChar(c)) {
|
||||||
return false;
|
continue;
|
||||||
}
|
}
|
||||||
|
successCount++;
|
||||||
}
|
}
|
||||||
return true;
|
return successCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean injectMouse(int action, int buttons, Position position) {
|
private boolean injectMouse(int action, int buttons, Position position) {
|
||||||
|
Loading…
Reference in New Issue
Block a user