I got the back button working for my game by overloading the “keyBackClicked” method and it works fine for all my layers. Now when I get to the main menu of my game I would like to force the game to enter background if the back button is pressed and not terminating the app. I want the back button to behave as if the home button was pressed.
I’ve tried ‘CCDirector::sharedDirector()->end();’ but that would actually terminate the game and I don’t want that.
I’m sorry the engine hasn’t implement this requirement. I think you can implement it by add custom JNI method.
BTW, I don’t think it’s a rational requirement. We can consider it from a user perspective:
If I press back, what I needed is quit the game/app.
When I want to let the game/app enter background, I will press home instead.