How to detect Device Back Button - Corona SDK

I am working on an app and I find myself trying to use the back button on my Galaxy S instead of the back button on the title bar at the top, and If I am doing it then so will many other people.

Does anyone know how I can detect and trap the "DEVICE BACK BUTTON" so that I may make it act like the normal back button in my app?

I have seen other android games detect this and work the way I want it to so was just wondering in Corona can do this as well.

I figure it's some type of system event, but not sure what..

Thanks

Larry
DoubleSlashDesign.com

with keyEvents

You can via "key" events. See the following...
http://developer.anscamobile.com/reference/index/events/key/eventkeyname

This feature is only available in our latest daily build, which is available if you are a subscriber.

Also check out the Corona SDK's sample app "Hardware\KeyEvents".

Fantastic I'll give put it in and give it a try..

Oh and here's a tip. We've discovered that Galaxy Tabs do not provide an "up" phase event for the Back key if you hold down the key for too long. This is because Galaxy Tabs steal that event from Corona and use it for screen captures. Because of this, I recommend that you use the "down" phase for the Back key.

Great Tip.. Will do. Thanks for the info.

Worked like a champ.. Tested on Galaxy S :)

views:3003 update:2011/9/28 8:56:32
corona forums © 2003-2011