Cocos Creator 监听安卓屏幕下方返回键

addEscEvent = function(node){
cc.eventManager.addListener({
event: cc.EventListener.KEYBOARD,
onKeyPressed: function(keyCode, event){
cc.hb.uiMgr.openPanel("Hall/alertBox/AlertBox",cc.hb.alertMgr.ANIMATE_CENTENT,"确认退出游戏吗?",function(success){
if (success){cc.game.end();}
}
);
},
onKeyReleased: function(keyCode, event){
if(keyCode == cc.KEY.back){
cc.log("")
}
}
}, node);
}

你可能感兴趣的:(Cocos Creator 监听安卓屏幕下方返回键)