detecting this key

I discovered a bug in my game in which they can exit the keyboard without triggering the cancelled or ended event on userinput event by pressing this button

ce79d82f944f4292a7d633e6f9518dfb.png

I tried to make a test program to see if any key event triggers from it which I found out it does not (my code)

local myText = display.newText( "", 100, 200, native.systemFont, 10 ) myText.alignX = "center" defaultField = native.newTextField(display.contentWidth/2, 30, 180, 30 ) function onKeyEvent( event ) myText.text = event.keyName .. " " ..event.phase .." "..(tostring(event.keyCode) or "").. " " .. (tostring(event.nativeKeyCode) or "") print(event.keyName,event.phase,event.keyCode,event.nativeKeyCode) return false end Runtime:addEventListener( "key", onKeyEvent )

Does anyone know a proper way to detect all ways a keyboard could be closed? or even check if it’s open

Coronas implementation of the native keyboard has a good amount of warts. If this is a showstopper, I’d suggest you create your own onscreen keyboard so that you can completely control user input.

I don’t think that would be worth the effort.

On Android, there is no reliable way in native code of detecting when a virtual keyboard has been dismissed.  Nor can you assume that a virtual keyboard is being displayed since a physical keyboard can be used either via bluetooth or built-in to the device like a Droid.  What you should do is handle text input like how it works in a desktop app and display a submit button onscreen for the user to tap.

Coronas implementation of the native keyboard has a good amount of warts. If this is a showstopper, I’d suggest you create your own onscreen keyboard so that you can completely control user input.

I don’t think that would be worth the effort.

On Android, there is no reliable way in native code of detecting when a virtual keyboard has been dismissed.  Nor can you assume that a virtual keyboard is being displayed since a physical keyboard can be used either via bluetooth or built-in to the device like a Droid.  What you should do is handle text input like how it works in a desktop app and display a submit button onscreen for the user to tap.