diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-07-05 15:34:18 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-07-06 09:53:50 +0300 |
commit | c687bfa697dcb5164fb26739de2567baffd7d162 (patch) | |
tree | 5c05598b6a96e026beac226fea8fb39c8949375c /platform/android/java/lib/src/org/godotengine/godot | |
parent | b7c2fd2e9a7f01644e15fef86083a3e0e0221e4d (diff) | |
download | redot-engine-c687bfa697dcb5164fb26739de2567baffd7d162.tar.gz |
[Android] Set `echo` property for the physical keyboard events.
Diffstat (limited to 'platform/android/java/lib/src/org/godotengine/godot')
3 files changed, 11 insertions, 11 deletions
diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java b/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java index c725b1a7c9..b9ecd6971d 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java +++ b/platform/android/java/lib/src/org/godotengine/godot/GodotLib.java @@ -147,7 +147,7 @@ public class GodotLib { /** * Forward regular key events. */ - public static native void key(int p_physical_keycode, int p_unicode, int p_key_label, boolean p_pressed); + public static native void key(int p_physical_keycode, int p_unicode, int p_key_label, boolean p_pressed, boolean p_echo); /** * Forward game device's key events. diff --git a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java b/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java index 317344f2a5..185d03fe39 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java +++ b/platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java @@ -141,7 +141,7 @@ public class GodotInputHandler implements InputManager.InputDeviceListener { final int physical_keycode = event.getKeyCode(); final int unicode = event.getUnicodeChar(); final int key_label = event.getDisplayLabel(); - GodotLib.key(physical_keycode, unicode, key_label, false); + GodotLib.key(physical_keycode, unicode, key_label, false, event.getRepeatCount() > 0); }; return true; @@ -176,7 +176,7 @@ public class GodotInputHandler implements InputManager.InputDeviceListener { final int physical_keycode = event.getKeyCode(); final int unicode = event.getUnicodeChar(); final int key_label = event.getDisplayLabel(); - GodotLib.key(physical_keycode, unicode, key_label, true); + GodotLib.key(physical_keycode, unicode, key_label, true, event.getRepeatCount() > 0); } return true; 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 f48dba56df..06b565c30f 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 @@ -93,8 +93,8 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene @Override public void beforeTextChanged(final CharSequence pCharSequence, final int start, final int count, final int after) { for (int i = 0; i < count; ++i) { - GodotLib.key(KeyEvent.KEYCODE_DEL, 0, 0, true); - GodotLib.key(KeyEvent.KEYCODE_DEL, 0, 0, false); + GodotLib.key(KeyEvent.KEYCODE_DEL, 0, 0, true, false); + GodotLib.key(KeyEvent.KEYCODE_DEL, 0, 0, false, false); if (mHasSelection) { mHasSelection = false; @@ -115,8 +115,8 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene // Return keys are handled through action events continue; } - GodotLib.key(0, character, 0, true); - GodotLib.key(0, character, 0, false); + GodotLib.key(0, character, 0, true, false); + GodotLib.key(0, character, 0, false, false); } } @@ -127,8 +127,8 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene if (characters != null) { for (int i = 0; i < characters.length(); i++) { final int character = characters.codePointAt(i); - GodotLib.key(0, character, 0, true); - GodotLib.key(0, character, 0, false); + GodotLib.key(0, character, 0, true, false); + GodotLib.key(0, character, 0, false, false); } } } @@ -136,8 +136,8 @@ public class GodotTextInputWrapper implements TextWatcher, OnEditorActionListene if (pActionID == EditorInfo.IME_ACTION_DONE) { // Enter key has been pressed mRenderView.queueOnRenderThread(() -> { - GodotLib.key(KeyEvent.KEYCODE_ENTER, 0, 0, true); - GodotLib.key(KeyEvent.KEYCODE_ENTER, 0, 0, false); + GodotLib.key(KeyEvent.KEYCODE_ENTER, 0, 0, true, false); + GodotLib.key(KeyEvent.KEYCODE_ENTER, 0, 0, false, false); }); mRenderView.getView().requestFocus(); return true; |