jingjie
24-06-2007 06:43:31
First, the QuickGUI is easy use and good design.
I wanna get the QuickGUI instead of CEGUI.
Before I used CEGUI to be typing chinese IME into EditBox or MultiEditBox , it is successful to display by receiving of Windows message WM_CHAR.
I don't understand that the textbox of QuickGUI how to supprted this feature with OIS KeyEvent.
To see:
http://www.cegui.org.uk/phpBB2/viewtopic.php?t=1052&highlight=
To see this:
Above that code , will arg.text of OIS::KeyEvent return the unicode character(like chinese) when I finish to type it by the IME?
On OIS::KeyEvent , Before QuickGUI::GUIManager::getSingleton().injectChar , should I translate MultiByteToWideChar by myself?
Master kungfoomasta, if you have any solution , could you tell me?
Thanks.
I wanna get the QuickGUI instead of CEGUI.
Before I used CEGUI to be typing chinese IME into EditBox or MultiEditBox , it is successful to display by receiving of Windows message WM_CHAR.
I don't understand that the textbox of QuickGUI how to supprted this feature with OIS KeyEvent.
To see:
http://www.cegui.org.uk/phpBB2/viewtopic.php?t=1052&highlight=
bool keyPressed( const OIS::KeyEvent &arg )
{
if( arg.key == OIS::KC_ESCAPE )
mShutdownRequested = true;
QuickGUI::GUIManager::getSingleton().injectKeyDown(static_cast<QuickGUI::KeyCode>(arg.key));
QuickGUI::GUIManager::getSingleton().injectChar( arg.text );
return true;
}
To see this:
#include <ctype.h>
inline int __cdecl isLeadByte(int _C)
{return ((unsigned char)(_C) & 0x80); }
(b)Modified wndProc()::case WM_CHAR to deal with Multi-Bye into Unicode then injectChar() is working well;
case WM_CHAR:
{
static char MultiByte[2]={0};
static bool isHaveMultiByte = false;
if (isHaveMultiByte)
{
isHaveMultiByte = false;
MultiByte[1] = (unsigned char) wParam;
int iLengthUnicode = 0;
wchar_t szUnicode;
MultiByteToWideChar(CP_ACP, 0, (char*)MultiByte, 2, &szUnicode, 1);
CEGUI::System::getSingleton().injectChar((CEGUI::utf32) szUnicode);
break;
}else{
if(isLeadByte(wParam))
{
isHaveMultiByte = true;
MultiByte[0] = (unsigned char)wParam;
}else {
CEGUI::System::getSingleton().injectChar((CEGUI::utf32)wParam);
break;
}
}
}
Above that code , will arg.text of OIS::KeyEvent return the unicode character(like chinese) when I finish to type it by the IME?
On OIS::KeyEvent , Before QuickGUI::GUIManager::getSingleton().injectChar , should I translate MultiByteToWideChar by myself?
Master kungfoomasta, if you have any solution , could you tell me?
Thanks.