0 votes

Hello i'm doing a mobile game and i create some code to move the camera when user is writing in a line edit, but if i hide the keyboard using back button the keyboard hide but the game do not detect that the keyboard is no longer there so the camera do not go back to the original position.

How i can check if a keyboard is visible?

in Engine by (71 points)

1 Answer

0 votes

getvirtualkeyboard_height ( ) will return 0 if the keyboard is not shown.
https://godot-es-docs.readthedocs.io/en/latest/classes/class_os.html?highlight=keyboard#method-descriptions

by (527 points)

ok i will try that ! thanks

getvirtualkeyboard_height ( ) is always 0 , is not working i have a galaxy A10, android 9 i don't know if that the reason, maybe do not work in this version of android

Odd, I've done it on both Android Pie and Android 10 and it worked. Are you using the builtin keyboard or a custom one?

the builtin keyboard, how you did it ? , you have an example code

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.