I gave that problem some more tries as I like scene2d UI a lot and don't really want to go for native Android UI (also because of the Desktop compatibility loss)...
So I thought about putting a hidden EditText field onto the screen, where I then could define the input type. When the user clicks on a scene2d TextField, the focus would be programmatically set to that hidden EditText, so the keyboard shows up. Finally, the key events need to be caught and the entered text is then filled back into the scene2d TextField.
After some research I found an old LibGDX github revision:
https://github.com/libgdx/libgdx/commit ... bdf46cac3f where - as I understand - exactly that was tried (see also the now unused
AndroidOnscreenKeyboard.java class)!
Now, my questions are:
- Does someone remember that AndroidOnscreenKeyboard class and knows if it ever worked, or why this approach was never pursued?
- I tried to implement this approach my own way and it all works to the point where I try to catch the key events. I tried to do that by setting AndroidInput as the EditText's OnKeyListener (as it is also done for the LibGDX view in AndroidInput's constructor). Later, I found out, setOnKeyListener does not work for the soft keyboard on all devices... That's why I wondered, why it does work in scene2d's TextField, since it is the exact same way to get the key events? Or might this be a so far undetected problem in scene2d?