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);}
相關文章
相關標籤/搜索