Detect If virtual keyboard is hided

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Manuel

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?

:bust_in_silhouette: Reply From: andersmmg

get_virtual_keyboard_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

ok i will try that ! thanks

Manuel | 2019-09-13 18:35

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

Manuel | 2019-09-13 18:51

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?

andersmmg | 2019-09-13 19:00

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

Manuel | 2019-09-14 01:07