How do you call that and how to trigger a function when it is pressed

Hi !
I need your help guys, here on the png is the button im talking about :

a8e9e9adf160eb840e46e148a840bfe8-full.pn

I’d like to go back to my mainMenu when this button is pressed but I don’t know what is his name, and I don’t know how to trigger something when it is pressed

Researching for that is a bit tricky when you dont know the name :s
Thanks for your time :slight_smile:

If you use composer, Corona’s official built-in scene manager, then you can read how to move between scenes here: https://docs.coronalabs.com/guide/system/composer/index.html

For buttons, there are various ways to approach this. You could create an imageRect and add a touch event listener to it, or you could create a button widget (see documentation https://docs.coronalabs.com/api/library/widget/newButton.html

Uh, yes in the case that the button is from my game it would work, i agree

But i’m talking about the button that every phone have, to go back to the previous “scene”

They are from the OS, i don’t know how to use them and if it is possible with Corona (I hope so)

f07d7dad48f35986ab3e12d1d5050c1a-full.pn  sciGCte.png

Maybe i’m wrong but i am pretty sure that thoses buttons are from the OS, not from any other application, so we can’t trigger simply with a imageRect listener

There must be a way to use theses buttons to trigger my functions, but i don’t how to search that because i don’t know the name of thoses buttons :x

Still thanks for the reply, I appreciate it :slight_smile:

Ah, right. Your original post’s image was broken, so I didn’t realise you meant those buttons. What you are looking for is the key event. There’s a specific example for the back button at https://docs.coronalabs.com/api/event/key/keyName.html

Ah ! Yes that’s it, thanks you ! :slight_smile:

If you use composer, Corona’s official built-in scene manager, then you can read how to move between scenes here: https://docs.coronalabs.com/guide/system/composer/index.html

For buttons, there are various ways to approach this. You could create an imageRect and add a touch event listener to it, or you could create a button widget (see documentation https://docs.coronalabs.com/api/library/widget/newButton.html

Uh, yes in the case that the button is from my game it would work, i agree

But i’m talking about the button that every phone have, to go back to the previous “scene”

They are from the OS, i don’t know how to use them and if it is possible with Corona (I hope so)

f07d7dad48f35986ab3e12d1d5050c1a-full.pn  sciGCte.png

Maybe i’m wrong but i am pretty sure that thoses buttons are from the OS, not from any other application, so we can’t trigger simply with a imageRect listener

There must be a way to use theses buttons to trigger my functions, but i don’t how to search that because i don’t know the name of thoses buttons :x

Still thanks for the reply, I appreciate it :slight_smile:

Ah, right. Your original post’s image was broken, so I didn’t realise you meant those buttons. What you are looking for is the key event. There’s a specific example for the back button at https://docs.coronalabs.com/api/event/key/keyName.html

Ah ! Yes that’s it, thanks you ! :slight_smile: