With my game, I need to check if arrow keys are down, and when number keys have been pressed.
To achieve this I added two boolean arrays to CCDirector called isKeyDown and wasKeyPressed. isKeyDown is used for arrow keys, and wasKeyPressed is used for item selection with number keys. I did it this way because I’m used to using this approach in other libraries like SDL.
This works fine for now, but I would like to eventually move towards another solution which doesn’t require any modifications to the actual cocos2d-x library. Just wondering if that is possible at the moment? From what I’ve read so far, keyboard support is still quite poor.