New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android AOSP Keyboard] Backspace key is not working #1941
Comments
Thanks for the bug report. I have a few things that I would like to see improved with the bug report to make it easier to understand the issue.
Once these issues are resolved, we can see to hopefully get this fixed 🙂 |
Hi @Jacalz, thanks for the pointers! Cheers and keep up the "fyne" work! |
Can you please share information about the Android devices and they keyboard that is loaded? |
Hello Andy, I think the issue is receiving the KEY_BACKSPACE event when using an Android AOSP keyboard which is the default on e.g. Lineage OS or other AOSP ROM flavours. Our customer is using a custom build ROM based on Android AOSP 9 on their devices which I am unfortunately unable to share. Device 1: Sailfish OS on Sony Xperia XA2, 10 I (the Android emulation layer is based on AOSP 8.1 or newer)
Device 2: Sony Xperia 10 Mark II (or any Android 8, 9 or 10 based device so S10 and Desire X should work, too) On the latter device which is stock Sony ROM I observe two behaviours:
HTH to analyse the issue any further. |
Small update on the issue. I analysed Fyne Android bindings and the culprit seems to be here mTextEdit.addTextChangedListener(new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
String logline = String.format("s.len() = %d, old.len() = %d, start = %d, before = %d, count = %d, s = '%s'", s.length(), oldState.length(), start, before, count, s.toString());
Log.e("Fyne", logline);
if (s.length() > oldState.length()) {
keyboardTyped(s.subSequence(oldState.length(), s.length()).toString());
} else if (s.length() < oldState.length()) {
// backspace key seems to be sent even for soft content (nope, it doesn't do on default AOSP keyboard)
Log.e("Fyne", "keyboardDelete() called");
keyboardDelete();
}
oldState = s.toString();
} Basically if you enter a single continous text without whitespace the backspace button works as expected. However if you enter whitespace Android AOSP keyboard is doing weird things calling the The second issue I found was moving the cursor in the Entry widget via touchscreen causes an "doShowKeyboard()" call that resets the Android EditText but previously entered text is still visible in the Fyne Entry widget, i.e. Fyne runtime still displays the previously entered text but Android runtime uses a new empty string. The effect is that you can paste fresh characters into the Entry widget but you can't edit the Fyne managed text as |
Thanks this is really helpful. |
On develop for testing :) |
Describe the bug:
To Reproduce:
Steps to reproduce the behaviour:
Screenshots:
none
Example code:
main.go:
go.mod:
Device (please complete the following information):
The text was updated successfully, but these errors were encountered: