CClayer onkeybackClicked not working as expected

CClayer onkeybackClicked not working as expected
0.0 0


I am able to get callback for back key press event in android phone??
I have cclayer gamescene class overrided onBackKeyPress event of CClayer and setkeypadenabled to true in gamescene constructor.but still i am not getting call back ?? Any help will be appreciated.


In my code it as does not work (js binding) :frowning:

var AbstractLayer = cc.Layer.extend({

    init: function () {
        var bRet = false;
        if (this._super()) {

    onKeyBackClicked: function () {
        cc.log("back key pressed");

any results in log. Cocos2d-x version 2.1.3 Help me please!


the name of the function in the C++ version is virtual void keyBackClicked()
is that what the binding is attached to? (i searched the docs for “onKeyBackClicked” and couldn’t find it)


Hi Justin!

I have found the “onKeyBackClicked” solution yesterday in this post
But yesterday I where that was mistaken at compilation.
Now this is working great :slight_smile:


PS: may be i forgoted clean my android project before compile it