ChangGil Han wrote: > Abdelrazak Younes wrote: > >> OK, then Georg is right about generating as many keypressEvent as there >> are characters in the inputMethodEvent. Please apply this patch and try >> again. > > Your patch works here both in linux and in windows box!!!
OK, thanks for testing. It's committed but I think there's still some work to do to support CJK correctly (see FIXMEs) and I count on you to help us there ;-) Abdel. Author: younes Date: Sat Feb 10 17:30:11 2007 New Revision: 17134 URL: http://www.lyx.org/trac/changeset/17134 Log: Minimal support for systems with input method (CJK). * GuiWorkArea::inputMethodEvent(): process a keyPressEvent() for each character of the commitString(). Modified: lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.C Modified: lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.C URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.C?rev=17134 ============================================================================== --- lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.C (original) +++ lyx-devel/trunk/src/frontends/qt4/GuiWorkArea.C Sat Feb 10 17:30:11 2007 @@ -575,14 +575,23 @@ << endl; int key = 0; + + // FIXME Abdel 10/02/07: Remove? // needed to make math superscript work on some systems // ideally, such special coding should not be necessary if (text == "^") key = Qt::Key_AsciiCircum; - // FIXME: Needs for investigation, this key is not really used, - // the ctor below just check if key is different from 0. - QKeyEvent ev(QEvent::KeyPress, key, Qt::NoModifier, text); - keyPressEvent(&ev); + + // FIXME Abdel 10/02/07: Minimal support for CJK, aka systems + // with input methods. What should we do with e->preeditString()? + // Do we need an inputMethodQuery() method? + // FIXME 2: we should take care also of UTF16 surrogates here. + for (int i = 0; i < text.size(); ++i) { + // FIXME: Needs for investigation, this key is not really used, + // the ctor below just check if key is different from 0. + QKeyEvent ev(QEvent::KeyPress, key, Qt::NoModifier, text[i]); + keyPressEvent(&ev); + } } e->accept(); }