SFML community forums
Help => General => Topic started 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:
sf::Keyboard::setVirtualKeyboardVisible(true);
For get input:
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);
}
}
}
}
-
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
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?
It's possible show a only numbers keyboard?
No, only standard keyboard so far.
-
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)
06-07 00:23:57.288: W/dalvikvm(27363): JNI WARNING: DeleteLocalRef(0x1d2001ce) failed to find entry
on Android v5.1.1 (Crash)
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!
-
Interesting, will have a look. :)
-
ok ;) if you need that i test any other update tell me!
Grettings!
-
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).