标签:des style blog color os ar for art div
修改cocos2d-x-3.x\cocos\2d\platform\desktop\CCGLView.cpp GLView::onGLFWCharCallback方法
//原来的方法如下:
void GLView::onGLFWCharCallback(GLFWwindow *window, unsigned int character)
{
IMEDispatcher::sharedDispatcher()->dispatchInsertText((const char*)&character, 1);
}
//修改后的方法如下:
void GLView::onGLFWCharCallback(GLFWwindow *window, unsigned int character)
{
if (character < 128)
IMEDispatcher::sharedDispatcher()->dispatchInsertText((const char*)&character, 1);
else
{
char szUtf8[8] = { 0 };
int nLen = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)&character, 1, szUtf8, sizeof(szUtf8), NULL, NULL);
IMEDispatcher::sharedDispatcher()->dispatchInsertText(szUtf8, nLen);
}
}
cocos2dx 3.x 解决输入框(TextField,TextFieldTTF) 输入中文变乱码的问题
标签:des style blog color os ar for art div
原文地址:http://www.cnblogs.com/atong/p/3945412.html