Home > other >  How to add game handle cocos2dx buttons
How to add game handle cocos2dx buttons

Time:09-23

Void StartLayer: : onKeyPressed (EventKeyboard: : KeyCode KeyCode, Event * Event)
{

If (keyCode==EventKeyboard: : keyCode: : KEY_UP_ARROW | | keyCode==EventKeyboard: : keyCode: : KEY_DPAD_UP)
{

}
Then add, write game handle key value is how much?

CodePudding user response:

The simplest method, at the time of capture key event, the corresponding code value output
  • Related