I’m not 100% sure but for cocos2dx 2.2 you need to trigger
dispatchKeypadMSG(kTypeBackClicked) of the
So just replace the two lines with the
EventKeyboard of this patch with something like
CCKeypadDispatcher::sharedDispatcher()->dispatchKeypadMSG(kTypeBackClicked). After that you just need to enable the keypad with
setKeypadEnabled(true) and put your code in
Again — I’m not sure and haven’t tested it! But maybe this is a good starting point for you!?