back-key and input text

back-key and input text
0.0 0


Hi everyone,
I converted my game from Cocos2d-x v2 to v3. As part of my conversion, I removed all the keyBackClicked() calls to registering a keyboard event listener.
I must say that even though I really love almost all v3 APIs, I’m not a fan of the alternative suggested to keyBackClicked() as seen here:

Nevertheless, I needed an alternative and I was able to implement this successfully. However, now I have a bug that whenever I add a TextFieldTTF to my layer and I try to use the keyboard to type, hitting backspace will also invoke the callback for my keyback. This is, obviously, undesired.

I really think that adding something like keypad listener would be a better idea over keyboard overriding with backspace. Alternatively, you could also add a virtual key for hardware back that is different from backspace, or even use the ESC button for that.

Any thoughts here?



When I was looking through the code and I saw that menu key and back key are bound to keyboard keys I couldn’t believe that. Obviously they should be separated.


Any chance this will be changed anytime?


To be clear - even though it won’t be ideal, I’m fine with defining a different key for hardware ‘back’ button - but overloading the BACKSPACE key is a bad idea


Even mapping of the hardware ‘back’ button to escape is better



currently the ‘back’ button is bounded to ‘escape’ now. at least on Android platform, I’m sure of that.