bool HelloWorld::init()
{
.。。。
。。。
auto listenerkeyPad = EventListenerKeyboard::create();
listenerkeyPad->onKeyReleased = CC_CALLBACK_2(HelloWorld::onKeyReleased, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(listenerkeyPad, this);
return true;
}
void HelloWorld::onKeyReleased(EventKeyboard::KeyCode keycode, Event* event)
{
//这个函数进不来
MessageBox(“You pressed the close button. Windows Store Apps do not implement a close button.”, “Alert”);
}