Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i find the height of soft-keyboard in a LibGDX application

I'm developing an Android game with LibGDX. And I need to find the height of the soft-keyboard the user is using, as I want to display some objects right above the keyboard.

I have read this thread: how can i get soft keyboard height on android?

But the comment suggests that it doesn't work, and it also seems to be for using with Android SDK. I'm not sure. Does anyone know a way that will definitely work?

like image 621
Hamzah Malik Avatar asked Dec 05 '13 20:12

Hamzah Malik


1 Answers

If your problem is that your textfields are obscured then I suggest using

void Gdx.input.getTextInput(Input.TextInputListener listener, java.lang.String title, java.lang.String text)

instead because that will generate a native modal text input dialog that moves up and down with the keyboard. I have tried to get the height of the keyboard as well but so far I haven't managed.

See answers for this thread as well: How do libgdx detect keyboard presence

like image 195
JohnyTex Avatar answered Oct 06 '22 18:10

JohnyTex