views:

116

answers:

1

Hello.

I'm currently making a game in XNA4 for Windows phone 7, and I'd like to know if it were possible to get the event of the return button, or even the windows button that are basically present on the phone's interface.

If so, how can i do that?

thanks,

KiTe

+2  A: 

At this point in time the SDK only allows you to get events off the back button. The windows button is like the iPhone main button - for all intents and purposes in your app it's a close button. When it's pressed, your app should save state and be ready to be terminated. The best event that you get for this is Exit event in Application class (App.xaml.cs).

In a Silverlight app, the back button fires a BackKeyPress event that lives off PhoneApplicationPage. In Silverlight, you might need to do things a little bit different.

This is the only thing I could find about getting a back key press event in an XNA application:

http://msdn.microsoft.com/en-us/library/bb203902.aspx

Igor Zevaka
The phone’s back button is mapped to the BackButton GamePad state of player index one. See http://forums.xna.com/forums/p/52875/320676.aspx for a more detailed discussion.
Bjoern