Hi!
I noticed another bug on Android.
I created a component with some child TextEditors. I tried to enter cyrillic text into the TextEditor via software keyboard but no symbols were entered. Other characters (with character code less than 128) can be inserted without a problem.
I tried various software keyboards (default Android keyboard, Samsung keyboard, “Hacker’s keyboard”), but none of them worked.
JUCE version I used: 3.0.1
Android version: 4.1.1
Steps to reproduce the bug
- Build Juce Demo application for Android, run it / install the apk.
- Open Juce Demo app, navigate to “Components: Tabs & Widgets” -> “Misc” tab.
- Switch your software keyboard to English language.
- Try to enter some text to “Single-line text box”, the text you enter should appear in the TextEditor.
- Now switch your software keyboard to Russian language.
- Try to enter some cyrillic text to the same TextEditor. No characters will be inserted.
I have a dirty fix for this bug.
In the Java code:
@Override
public boolean onKeyDown (int keyCode, KeyEvent event)
{
switch (keyCode)
{
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
return super.onKeyDown (keyCode, event);
default: break;
}
return true;
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
int kc = event.getUnicodeChar();
if (event.getCharacters() != null && kc == 0)
{
String chars = event.getCharacters();
kc = chars.charAt(0);
}
else if (event.getAction() != KeyEvent.ACTION_DOWN)
{
return true;
}
handleKeyDown (host, event.getKeyCode(), kc);
return true;
}
@Override
public boolean onKeyUp (int keyCode, KeyEvent event)
{
return true;
}