c0bb5a2d1f
When a soft keyboard's backspace sends KEYCODE_DEL via sendKeyEvent(), GodotEditText.onKeyDown() delegates to super.onKeyDown() which modifies the EditText's Editable, triggering beforeTextChanged() in GodotTextInputWrapper, which then forwards KEYCODE_DEL to the engine. However, the EditText is only seeded with text up to the cursor position (mOriginText) when the keyboard opens. Once the user backspaces through all of that content, the EditText becomes empty. At that point, super.onKeyDown(KEYCODE_DEL) on an empty EditText makes no change to the Editable, so beforeTextChanged() never fires and the engine receives no DEL event — even though the engine's own buffer still has text before the cursor. This causes a visible bug: the user can delete characters they typed in the current session, but backspacing further into pre-existing text does nothing. Re-tapping the field fixes it temporarily because showKeyboard() is called again, reseeding the EditText with the current text and cursor position. Fixed this by forwarding KEYCODE_DEL directly to the engine when the EditText is empty, bypassing the TextWatcher path that can't fire in that state. This produces no double events since beforeTextChanged() is physically unable to fire on an empty field. Move DEL release event from onKeyDown to onKeyUp
Android platform port
This folder contains the Java and C++ (JNI) code for the Android platform port, using Gradle as a build system.
Documentation
- Compiling for Android
- Instructions on building this platform port from source.
- Exporting for Android
- Instructions on using the compiled export templates to export a project.
Artwork license
logo.svg and run_icon.svg are licensed under
Creative Commons Attribution 3.0 Unported
per the Android logo usage guidelines:
The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.