Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

请问Creator在android里如何监听返回键?

$
0
0

@esygame 写道:

目前试过的方法
Activity里监听
onKeyDown, onKeyUp都不行,

jsb里

    onEnable: function () {
        this.keyListener = {
            event: cc.EventListener.KEYBOARD,
            onKeyPressed: function (keyCode, event) {
                cc.log('keyDown: ' + keyCode);

            },
            onKeyReleased: function (keyCode, event) {
                cc.log('keyUp: ' + keyCode);
            }
        }

        cc.eventManager.addListener(this.keyListener, this.node);
    },
    
    onDisable: function () {
        
    },

也不行

帖子: 3

参与者: 1

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>