Bug with hardware buttons (Android)

I noticed that the Android hardware buttons (menu, back, volume+, volume-) do not work when my Corona activity has focus.  This occurs with my own project, a sample project, and the Corona fishies sample project.

Sometimes the hardware buttons work right after launching my app, but if i hit the home button then come back to the app, the hardware buttons no longer work.

This is a deal breaker because I have to allow users to use volume+, volume- and the back button.

Have you checked to see if the key events are going into your lua files?  When the Corona View has focus the key events should be going there.

I checked and I’m not getting the key events to the Corona view.  

Hi,

This has been fixed and will be in the next build.  You will now get the key events in your Lua code.

If my lua code ignores the volume+/volume- keys, will the volume keys successfully change the system volume?  that’s what I need to happen.

I’m not sure about Cards, but in SDK just return false and the keys should go on to the OS.

Rob

Just tried the new build. I’m running into two issues:

  1. When my app first launches and the CoronaView is displayed, the CoronaView is not getting the key events. Strangely though, if I go to home screen then come back to my app and the CoronaView resumes, the key events do get sent do my Corona view.

  2. I need to handle the menu hardware key so that my Corona code can show a menu, and the back key so that it can do the appropriate thing, but I do not want to handle the Volume+/Volume-, as I want the OS to change the system volume as usual.  But when I return false in my key event listener for Volume+/Volume-, the system volume doesn’t change when I push the Volume+/Volume- buttons, as if the keys are not getting passed on to the OS.

Checking in to see if there is any progress on this. Thanks.

Its on our list but its not the top priority at the moment.  Will definitely l look into within a few weeks though.

Can’t believe this isn’t a high priority. It’s an absolute show-stopper for me, as users of my app will hate the fact that the volume keys don’t work when using my app. Volume keys should always work - it’s one of the basic functions of a phone.

Still desperately waiting for this. Can’t release an app that inadvertently disables the volume controls on a user’s phone.  Any updates on this?

A fix has been made and will be in the next daily build.  The key events won’t be dispatched to lua.  If you want to listen to key events then you will have to register a OnKeyListener view the setOnKeyLIstener method.

Great thanks. I just tried it and it works now.

Have you checked to see if the key events are going into your lua files?  When the Corona View has focus the key events should be going there.

I checked and I’m not getting the key events to the Corona view.  

Hi,

This has been fixed and will be in the next build.  You will now get the key events in your Lua code.

If my lua code ignores the volume+/volume- keys, will the volume keys successfully change the system volume?  that’s what I need to happen.

I’m not sure about Cards, but in SDK just return false and the keys should go on to the OS.

Rob

Just tried the new build. I’m running into two issues:

  1. When my app first launches and the CoronaView is displayed, the CoronaView is not getting the key events. Strangely though, if I go to home screen then come back to my app and the CoronaView resumes, the key events do get sent do my Corona view.

  2. I need to handle the menu hardware key so that my Corona code can show a menu, and the back key so that it can do the appropriate thing, but I do not want to handle the Volume+/Volume-, as I want the OS to change the system volume as usual.  But when I return false in my key event listener for Volume+/Volume-, the system volume doesn’t change when I push the Volume+/Volume- buttons, as if the keys are not getting passed on to the OS.

Checking in to see if there is any progress on this. Thanks.