Detecting When Android Keyboard Is Cancelled By Back Key

hi.

i have a problem, 

how do i detect when a keybord is closed by the back key on android devices ?

i think it’s very a basic thing to find out, and in the corona api I can’t find an answer.

i tried listening for pressing on the screen with the function:

Runtime:addEventListener( “key”, onKeyEvent );

but it can’t detect the first back key.

i noticed this question was asked before with no reply …in here:

http://forums.coronalabs.com/topic/32900-detecting-when-android-keyboard-is-cancelled-by-back-key/

CORONA PLS ? how can i detect the back from keybord ? 

There currently isn’t a way to detect if the virtual keyboard has been dismissed.  Plus, it may be a bad assumption that the virtual keyboard is displayed at all since some Android devices provide physical keyboards and is used by default if currently open.

Regarding the “back” key, your Lua listener will not receive a “back” key event if the virtual keyboard steals it, which it will do when dismissing itself.  That’s actually default Android behavior.

There currently isn’t a way to detect if the virtual keyboard has been dismissed.  Plus, it may be a bad assumption that the virtual keyboard is displayed at all since some Android devices provide physical keyboards and is used by default if currently open.

Regarding the “back” key, your Lua listener will not receive a “back” key event if the virtual keyboard steals it, which it will do when dismissing itself.  That’s actually default Android behavior.

But if possible, it would be interesting to setup a flag when a virtual keyboard exists and is openned. That way, I believe it would be possible to know when it dismisses too and have an event for such cases.

But if possible, it would be interesting to setup a flag when a virtual keyboard exists and is openned. That way, I believe it would be possible to know when it dismisses too and have an event for such cases.