소스 검색

Queue the calls to GodotLib.key when Android virtual done is pressed

Marcel Admiraal 4 년 전
부모
커밋
1856f16378
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 3
      platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java

+ 4 - 3
platform/android/java/lib/src/org/godotengine/godot/input/GodotTextInputWrapper.java

@@ -144,9 +144,10 @@ 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);
-
+			mRenderView.queueOnRenderThread(() -> {
+				GodotLib.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, true);
+				GodotLib.key(KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_ENTER, 0, false);
+			});
 			mRenderView.getView().requestFocus();
 			return true;
 		}