From 2bd3cc0e1661b55e848ded3bb8592c4b45d71a25 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Tue, 6 Jul 2021 17:54:14 +0100 Subject: [PATCH] Queue the calls to GodotLib.key when Android virtual done is pressed --- .../godotengine/godot/input/GodotTextInputWrapper.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java b/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java index 5268f850b89..0a252fb78c9 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java +++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java @@ -144,10 +144,11 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene if (pActionID == EditorInfo.IME_ACTION_DONE) { // Enter key has been pressed - GodotLib.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, true); - GodotLib.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, false); - - this.mView.requestFocus(); + mView.queueEvent(() -> { + GodotLib.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, true); + GodotLib.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, false); + }); + mView.requestFocus(); return true; } return false;