1
0
Fork 0

prevent unnecessary double ENTER event for sending messages, when there is no message to send

This commit is contained in:
Dimo Karaivanov 2023-08-28 10:11:11 +03:00
parent c881aa0fd7
commit c878468046

View file

@ -148,6 +148,12 @@ public class AppHacks {
sendDownUpKeyEvents(KeyEvent.KEYCODE_DPAD_CENTER);
// If there is no text, there is nothing to send, so there is no need to attempt any hacks.
// We just pass through DPAD_CENTER and finish as if the key press was handled by the system.
if (oldText.isEmpty()) {
return true;
}
try {
// In Android there is no strictly defined confirmation key, hence DPAD_CENTER may have done nothing.
// If so, send an alternative key code as a final resort.