A simple way to support IME, modify CIrrDeviceWin32.cpp, in WinProc function, add the following code:
case WM_IME_CHAR:
dev = getDeviceFromHWnd (hWnd);
If (dev) (
Event.EventType = irr:: EET_KEY_INPUT_EVENT;
Event.KeyInput.PressedDown = true;
Event.KeyInput.Key = irr:: KEY_OEM_CLEAR;
Event.KeyInput.Shift = 0;
Event.KeyInput.Control = 0;
char bits [2] = { (char) ((wParam & 0xff00)>> 8), (char) (wParam & 0xff) };
if (bits [0] == 0) event.KeyInput.Char = (irr:: u16) wParam;
else MultiByteToWideChar (CP_OEMCP, MB_PRECOMPOSED, bits, 2, & event.KeyInput.Char, 1);
dev-> postEventFromUser (event);
)
break;
Full-screen mode, can not show IME panel, but we can do a fake full-screen, style = WS_POPUP, full screen size, not title bar...
Welcome to test vector font support, upgrade 0.3 version:
(support FreeType and Windows APIs, #define _IRR_USE_FREETYPE_)
IGUIFontVector* vfont = (IGUIFontVector*)env->getFont("c:/Windows/fonts/msyh.ttf"");
env->addEditBox(L"请输入文字", rect<s32>(300,400,550,430))->setOverrideFont(vfont);
Change font size:
IGUIFontVector* font=(IGUIFontVector*)TextBox1->getOverrideFont();
font=font->getNewSizeFont(newWidth,newHeight);
if (font){ TextBox1->setOverrideFont(font); }
Download URL:
http://cwowaddon.googlegroups.com/web/I ... eZD07aX2iN
A simple way to support IME
A simple way to support IME
Last edited by zhaojs on Wed Jun 25, 2008 4:02 pm, edited 3 times in total.
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
What would lead you to believe that it might not be?
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 70
- Joined: Tue Oct 28, 2008 12:59 pm