steve3d Posted October 21, 2011 Share Posted October 21, 2011 almost all game engine in our country support this, when a user need to input some text strings, he open a ime and input some text into the text widget, if text widget is not active, and when he press some key like 'w', the ime window will not receive this key, instead, the engine received the w key then character walks. but in unigine, things are different, when I input some text into WidgetEditLine, then I close the window there will be no widget can receive text input, but when I press w/a/s/d, the active ime received the key, unigine doesn't respond to the movement keys. I hope I've made my suggestions clear enough: when there is no gui widget in focus, unigine should receive the keys and don't let ime receive these keys. Link to comment
danni.coy Posted October 21, 2011 Share Posted October 21, 2011 For the editor this can be a bit tricky... for my own stuff I used the following code when I need to make sure that nothing in the UI is focused. Widget w = engine.app.getFocus(); if(w != 0) w.removeFocus(); input that uses the input system should work the way you have requested (I think). Link to comment
manguste Posted October 21, 2011 Share Posted October 21, 2011 Unable to reproduce this problem. If the engine does not react to keys, something still retains the focus. Link to comment
steve3d Posted October 21, 2011 Author Share Posted October 21, 2011 well, actually, it's not a bug nor problem, any normal program will behave like this, look the attachement in this picture, I've activated ime to input some Chinese text in this picture, no widget is in focus, and I didn't close ime, then try to input some control keys to unigine, but all my input are captured by ime, I mean this can be improved, when there is no widget in focus, the ime should be temporary disable(not close). when there is a widget in focus again, the ime should be enable again. Link to comment
steve3d Posted October 21, 2011 Author Share Posted October 21, 2011 well, just googled something, it seems what I want is a little complicated http://msdn.microsoft.com/en-us/library/ee419002.aspx Link to comment
steve3d Posted October 22, 2011 Author Share Posted October 22, 2011 solved, easy hack: // get imm input handle HIMC context = ImmGetContext(app->window); if(context) { Widget *widget = engine.gui->getFocus(); BOOL open = FALSE; if(widget) open = (widget->getType() == Widget::WIDGET_EDITLINE || widget->getType() == Widget::WIDGET_EDITTEXT); ImmSetOpenStatus(context, open); ImmReleaseContext(app->window, context); } add these code to beginning of AppWindow::doUpdate(), this will test if current focused widget is a WidgetEditLine or WidgetEditText, if it is, it will enable ime input, if not it will disable ime input, so that unigine can capture all input by user. Link to comment
david.tang Posted September 12, 2013 Share Posted September 12, 2013 Why I can't input chinese char into Unigine editline widget with google's pinyin IME? I use Unigine 2013-8-16 in WIN7 64bits. Link to comment
frustum Posted September 14, 2013 Share Posted September 14, 2013 IME support is not working for external windows right now. We will fix it soon. Link to comment
Recommended Posts