Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top