0

I have the following code:

#include "s3e.h"

int main()
{
    // Wait for a quit request from the host OS
    while (!s3eDeviceCheckQuitRequest() 
        && !(s3eKeyboardGetState(s3eKeyEsc) & S3E_KEY_STATE_DOWN)
        && !(s3eKeyboardGetState(s3eKeyAbsBSK) & S3E_KEY_STATE_DOWN)
        && !(s3eKeyboardGetState(s3eKeyBack) & S3E_KEY_STATE_DOWN))
    {
        ...
    }
    return 0;
}

the problem is, when i press the back button on the WP8 device, the app does not close and I dont know why. Ans tipps?

gurehbgui
  • 14,236
  • 32
  • 106
  • 178

1 Answers1

0

Don't check for S3E_KEY_STATE_DOWN, instead use S3E_KEY_STATE_PRESSED.

And just as a suggestion, do not put functionality to terminate your app. There's already a Windows button on phone to pause your app and it'll eventually be terminated by OS itself when it deemed fit. Apple is known to reject app which has quit functionality(Mine got rejected twice) and I am sure Microsoft will follow the suit too.

Update:-
Microsoft UI guidelines suggest that the app should close on pressing back key on main menu/homescreen of the app/game.

0xC0DED00D
  • 19,522
  • 20
  • 117
  • 184
  • can u please tell what to write inside while loop ? – Adi Aug 26 '13 at 19:24
  • @AdarshGumashta post another question about the problem or query you have. Show us what you already tried and what's not working. If I can, I'll add the answer there. I get email notification for all marmalade questions, so I'll be notified. – 0xC0DED00D Aug 26 '13 at 21:31
  • @Creator as far as i know Microsoft allows the quit option when pressing back, in fact i think they mention it in the documentation. – Estevex Sep 04 '13 at 15:54
  • @Estevex yeah I noticed it already, didn't update the answer. Actually it's been mentioned in the UI guidelines that the app should quit on pressing back key on home menu. Thanks for pointing it out though. :-D – 0xC0DED00D Sep 04 '13 at 16:04