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 [import]uid: 11860 topic_id: 13003 reply_id: 313003[/import]

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. [import]uid: 32256 topic_id: 13003 reply_id: 47797[/import]

Also check out the Corona SDK’s sample app “Hardware\KeyEvents”. [import]uid: 32256 topic_id: 13003 reply_id: 47798[/import]

Fantastic I’ll give put it in and give it a try… [import]uid: 11860 topic_id: 13003 reply_id: 47802[/import]

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. [import]uid: 32256 topic_id: 13003 reply_id: 47805[/import]

Great Tip… Will do. Thanks for the info. [import]uid: 11860 topic_id: 13003 reply_id: 47806[/import]

Worked like a champ… Tested on Galaxy S :slight_smile: [import]uid: 11860 topic_id: 13003 reply_id: 47809[/import]

with keyEvents [import]uid: 24641 topic_id: 13003 reply_id: 47760[/import]

i’m working on a app and i want to detect device buttons i’m able to detect back button but i want to detect setting,menu and search button too… how it happened…??? anyone knows about that if so please post it… thanks [import]uid: 132856 topic_id: 13003 reply_id: 102226[/import]