oh … I want to know what I should include and coding if I want to call a function when I press a key on the keyboard…with win8 and cocos2d-x
help me … guys ~
oh … I want to know what I should include and coding if I want to call a function when I press a key on the keyboard…with win8 and cocos2d-x
help me … guys ~
I added keyboard support for the OSX and submitted it to the team as a prototype. Some adaptation of it should appear in the next release (2.0.5). It someone has added windows delegates before then you may be in luck. I only added the Obj-C OSX delegates.
This is how I did it for my Windows 8 game, Noogra Nuts:
On the DirectXRender.cpp Add the following lines:
window->KeyDown += ref new TypedEventHandler(this, &DirectXRender::OnKeyDown);
window->KeyUp += ref new TypedEventHandler(this, &DirectXRender::OnKeyUp);
Than you can passed the data to cocos2d::CCEGLView::sharedOpenGLView().OnKeyDown and hadnle it there.
Hello
So I can send the virtual key information to my CCEGLView’s OnKeyDown and OnKeyUp function, but can someone help me with coding something like
CCKeyboardDelegate
CCKeyboardDispatcher
CCKeyboardHandler
CCKeyboard
For windows 8?