Coco2d-x v3.3 - Universal Apps, keyboard support

Hi,

anyone implemented keyboard support for Win 8.1 Universal apps for Cocos2d-x v3.3 and would like to share some details about it?

BR

Eirik

Is keyboard not working for Win8.1? Here is a KeyboardTest in cpp-test project, let me know if it works on 8.1

Hi thank you for your reply.

We can’t see any direct KeyboardTest in the cpp-test project, the closest we see is things like TextInput test. However, we cannot see any code for keyboard under winrt anyhow so I doubt there is keyboard support implemented i.e. “PC” keyboard support, winrt only supports virtual keyboard it looks like and this is not much use on the desktop platform. So we’re looking into implementing PC keyboard support for winrt/WUA and was wondering if someone else had already done that and could share some details.

Cheers,

Eirik

Sorry it was under EventDispatcher tests, check it out here

The way keyboard support works is that we get keyboard events from glfw and then pass them to cocos2d-x, you can see the code here

So if you want to do something for winrt, I think you can start from this or this. I’m not sure which one is currently been used it’s been updated by Microsoft.

Thank you for your reply.

Yes, but those test seems related to label and text input etc, like mentioned. The winrt has support for text input but its via the IME/virtual keyboard, not physical (PC) keyboard as far as we can see.

Yes, we know how keyboard support is implemented on the other desktop platforms like Win32 and OSX. However, I was not aware of that glfw is compatible with winrt? I believe there is a different (and possible more apporiate) solution to handle keyboard input with winrt.

Anyhow, we’ll look into it, thanks for your help.

BR

Eirik

Any new info on this? We’d like to allow keyboard shortcuts if a hardware keyboard is connected in a WinRT or Windows Universal Store version of the game.

I’m also looking forward for keyboard support on windows universal

WinRT support for physical keyboard was added to cocos2d-x-3.7rc0 and cocos2d-x-3.7 is now official out.

2 Likes