Tried your branch with Win32 keyboard support, and it works great, thanks! I’m running Windows 8, compiling on VS 2012 Express.
However, I had to make some changes, one of them being the addition of the CCKeyboardDispatcher files to the cocos2d project. Also:
In CCEGLView.cpp, modified the calls to the keyboard dispatcher to 1 line, like this:
Line 303 -> pDirector->getKeyboardDispatcher()->setKeyPressDelegate(nullptr);
Line 304 -> pDirector->getKeyboardDispatcher()->setKeyReleaseDelegate(nullptr);
Finally, in CCKeyboardDispatcher.cpp:
Line 36 -> : _keyPressDelegate(nullptr)
Line 37 -> , _keyReleaseDelegate(nullptr)
Is this correct? It worked on OSX, but I did not test on Linux. Would it be better to implement the delegate the same way the Keypad Dispatcher does?
I also changed the line 527 on CCEventDispatcher.mm (
keyPressed() was being called when releasing a key):