When selecting the Samsung keyboard as default keyboard on recent Samsung phones and tablets, trying to enter texts in a JUCE TextEditor will fail. It fails in different ways:
Although backspace usually works, tapping on a character does not show up until you press the Done button. Sometimes, pressing a button on the keyboard makes it press the button left to the button you are pressing. Furthermore, when using voice commands, only the first letter of the word that is spoken is entered in the TextEditor. I donāt really care about the last one, but the others make it unusable on Samsung devices.
When switching to the Google GBoard however, no such problems exist. When the Samsung keyboard goes in a mode that it doesnāt suggest text, it also works ok, so perhaps changing outAttrs.inputType = InputType.TYPE_NULL;
in ComponentPeerView.java
to InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
might work.
EDIT: I did the change to ComponentPeerView.java, copied the file into my project and changed the cpp file to not take the bytecode and now it works on my S9. On the Tab S3, it didnāt work and I had to set it to
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD
Any updates on this issue? Weāve just had a report from a user on a Samsung A40, saying they are unable to type into a text field which is a JUCE TextEditor.
Did you try something similar to my patching of adding the not use auto-correct flag?
It might help. if it does, would be nice to share you userās insights here.
Just to confirm, the issue is with the default Samsung keyboard. Installing Gboard from Google Play and using that as the default keyboard fixes the issue.
Any updates on this issue? I got a tip off that it might have been fixed in JUCE 6.0.5, but alas no. I want to be sure there isnāt a fix around in JUCE before embarking on using native Android text input fields and JNI to workaround the issue.
Sorry, Iām fixing some other issues so I canāt take a look at this at the moment. Iām not aware of any changes that have been made in this area in the last few months.
On Android, Wotja avoids these problems by specifically displaying our own Text Editor native Java Activity (rather than using the built-in Juce text editor).
I ended up with a rather convoluted hack, involving ComponentListeners on TextEditors, a custom app Activity, and various JNI and Java methods to create and manage native Android TextEdit components on top of the JUCE ones, with callbacks to send the text from Java to C++. Itās ugly but it works. It also has the advantage of looking and behaving like a native text field.
I have a similar issue with my own custom framework (not using JUCE).
I capture soft keyboard input through onKeyDown() in my implementation of GL2JNIView. Then I forward the character through JNI to my C++ UI framework.
On some devices (Samsung A20e for example), letters donāt show up when typing them. But if I hit for example a ā.ā after a character, it makes the character appear. Backspace works as well.
I experienced the same issue testing on a Xiaomi phone a couple of years ago.
If you find the root of the issue Iām very interested to know what it is.