# Samsung keyboard doesn't work correctly with TextEditor

**URL:** <https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583>\
**Category:** Android\
**Created:** [May 20, 2020, 9:33pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583 "2020-05-20T21:33:59Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveAE](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@DaveAE](https://forum.juce.com/u/DaveAE)\
**Post date:** [May 20, 2020, 9:33pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/1 "2020-05-20T21:33:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![danisonuus](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/danisonuus/32/8768_2.png) [@danisonuus](https://forum.juce.com/u/danisonuus)\
**Post date:** [June 12, 2020, 2:54pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/2 "2020-06-12T14:54:19Z")

</div>

This should be integrated into master IMHO since the current support for smart soft keyboards is pretty much broken

---

<div class="post-metadata">

**Author:** ![mrotschi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mrotschi/32/4764_2.png) [@mrotschi](https://forum.juce.com/u/mrotschi)\
**Post date:** [June 12, 2020, 3:08pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/3 "2020-06-12T15:08:04Z")

</div>

This “fix” seems to have a drawback… According to some forums, it works only with latin keyboards.

---

<div class="post-metadata">

**Author:** ![ttg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ttg/32/14456_2.png) [@ttg](https://forum.juce.com/u/ttg)\
**Post date:** [June 12, 2020, 3:38pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/4 "2020-06-12T15:38:24Z")

</div>

Anyone overall JUCE has this issue for a while now.  
another one of those feedbacks that got lost 🙂

> [@JUCE mobile keyboard shouldn't have autocorrect](https://forum.juce.com/t/juce-mobile-keyboard-shouldnt-have-autocorrect/37990):
>
> I didn’t try too much but from my experience juce::TextEditors don’t cope well with auto-correct/completion. Wouldn’t it be better to have JUCE explicitly ask for no-autocorrect? here’s a patch from what I saw at least: diff --git a/modules/juce\_gui\_basics/native/java/app/com/roli/juce/ComponentPeerView.java b/modules/juce\_gui\_basics/native/java/app/com/roli/juce/ComponentPeerView.java index 9a43aa5ec..031e3d745 100644 --- a/modules/juce\_gui\_basics/native/java/app/com/roli/juce/ComponentPeerV…

---

<div class="post-metadata">

**Author:** ![danisonuus](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/danisonuus/32/8768_2.png) [@danisonuus](https://forum.juce.com/u/danisonuus)\
**Post date:** [June 13, 2020, 9:09am UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/5 "2020-06-13T09:09:55Z")

</div>

That’s a real shame ☹

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [December 2, 2020, 1:00pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/6 "2020-12-02T13:00:45Z")

</div>

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.

@ttg did you find a workaround?

---

<div class="post-metadata">

**Author:** ![ttg](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/ttg/32/14456_2.png) [@ttg](https://forum.juce.com/u/ttg)\
**Post date:** [December 7, 2020, 8:44am UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/7 "2020-12-07T08:44:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [December 16, 2020, 10:23am UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/8 "2020-12-16T10:23:21Z")

</div>

Unfortunately that patch does not fix the issue we’re seeing on Samsung phones.

However, I still think it should be merged into JUCE as autocorrect should be off by default IMO.

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [December 16, 2020, 10:38am UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/9 "2020-12-16T10:38:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [April 15, 2021, 2:29pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/10 "2021-04-15T14:29:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![reuk](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/reuk/32/21494_2.png) [@reuk](https://forum.juce.com/u/reuk)\
**Post date:** [April 15, 2021, 2:36pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/11 "2021-04-15T14:36:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [April 15, 2021, 2:37pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/12 "2021-04-15T14:37:23Z")

</div>

Ok, thanks for the update!

---

<div class="post-metadata">

**Author:** ![peteatjuce](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/peteatjuce/32/2347_2.png) [@peteatjuce](https://forum.juce.com/u/peteatjuce)\
**Post date:** [April 16, 2021, 3:28pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/13 "2021-04-16T15:28:36Z")

</div>

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).

HTH, Pete

---

<div class="post-metadata">

**Author:** ![adamwilson](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/adamwilson/32/1387_2.png) [@adamwilson](https://forum.juce.com/u/adamwilson)\
**Post date:** [May 19, 2021, 2:30pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/14 "2021-05-19T14:30:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![peteatjuce](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/peteatjuce/32/2347_2.png) [@peteatjuce](https://forum.juce.com/u/peteatjuce)\
**Post date:** [May 19, 2021, 2:44pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/15 "2021-05-19T14:44:17Z")

</div>

Yeah, that is basically what I did 🙂

I’d hope that at some point the Juce team might provide a better implementation.

The same sort of issue applies if you want to use the CodeEditorComponent on Android.

---

<div class="post-metadata">

**Author:** ![blegoff](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/blegoff/32/10583_2.png) [@blegoff](https://forum.juce.com/u/blegoff)\
**Post date:** [May 26, 2021, 4:21pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/16 "2021-05-26T16:21:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jimc](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jimc/32/16067_2.png) [@jimc](https://forum.juce.com/u/jimc)\
**Post date:** [July 27, 2022, 8:02pm UTC](https://forum.juce.com/t/samsung-keyboard-doesnt-work-correctly-with-texteditor/39583/17 "2022-07-27T20:02:36Z")

</div>

Any progress on this?
