SFML community forums

Help => General => Topic started by: CytraL on June 06, 2015, 04:34:28 pm

Title: [Android] Keyboard issues
Post by: CytraL on June 06, 2015, 04:34:28 pm
Hi! i have a problem with keyboard... in some devices when i show the keyboard it get stuck... you can't type anything (or very laggy)... :\

Other... it's possible know when the user active the keyboard? It's possible show a only numbers keyboard?

Thx!


For show keyboard:
Code: [Select]
sf::Keyboard::setVirtualKeyboardVisible(true);
For get input:
Code: [Select]
    while (m_Window.isOpen() && !m_CloseApp)
    {
    // Events
        sf::Event event;
        while (m_Window.pollEvent(event))
        {
            if (event.type == sf::Event::TextEntered)
            {
            int ckey = static_cast<char>(event.text.unicode);
            if (m_pHotGUIEntity && m_pHotGUIEntity->getType() == CGUIEntity::EDITBOX && event.text.unicode < 128)
            {
            CEditBox *pEditBox = static_cast<CEditBox*>(m_pHotGUIEntity);
            pEditBox->onTextEntered(ckey);
            }
            }
        }
    }
Title: Re: [Android] Keyboard issues
Post by: Mario on June 06, 2015, 09:54:25 pm
The lagginess might be related to some leak in the existing JVM/JNI interaction code. Anything suspicious showing in logcat?

You could try this commit/branch to see whether it fixes your issue: https://github.com/SFML/SFML/commit/40248b65c309c5b95e57dd4c21f74668be89b4da

Quote
Other... it's possible know when the user active the keyboard?
Do you mean typing? You should receive events. Or are you talking about the keyboard being visible?

Quote
It's possible show a only numbers keyboard?
No, only standard keyboard so far.
Title: Re: [Android] Keyboard issues
Post by: CytraL on June 07, 2015, 12:32:05 am
Quote
Do you mean typing? You should receive events. Or are you talking about the keyboard being visible?
I talking about keyboard being visible.

I probe the commit and have this results:
on Android v4.0.4 (Warning)
Code: [Select]
06-07 00:23:57.288: W/dalvikvm(27363): JNI WARNING: DeleteLocalRef(0x1d2001ce) failed to find entry

on Android v5.1.1 (Crash)
Code: [Select]
06-07 00:28:15.437: A/art(30841): art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: DeleteLocalRef on global reference: 0x100ae2

Thx for reply!
Title: Re: [Android] Keyboard issues
Post by: Mario on June 07, 2015, 10:21:32 am
Interesting, will have a look. :)
Title: Re: [Android] Keyboard issues
Post by: CytraL on June 07, 2015, 08:10:11 pm
ok ;) if you need that i test any other update tell me!

Grettings!
Title: Re: [Android] Keyboard issues
Post by: CytraL on June 08, 2015, 06:08:19 am
With SFML 2.3 when shown the keyboard on a mobile with Android 5.1.1 it seems that not handle the input (tap)... as if it will not be drawn on front. If you try 'click' many times you can press a random key (or not.. the key that works one time don't work in all tries).