Android back key enabled in cocos2d-x | Techbirds
How to enable the android back button key in cocos2d-x Step 1. In your .h file which is inheriting CCLayer, write virtual void keyBackClicked(); Step 2. Define this function in your .cpp file void HelloWorld:: keyBackClicked() { //my code } Step 3. In your init() or onEnter method, write this->setKeypadEnabled(true); And you are done.. HAPPY