From: Abdelrazak Younes Date: Sat, 10 Feb 2007 16:30:11 +0000 (+0000) Subject: Minimal support for systems with input method (CJK). X-Git-Tag: 1.6.10~10855 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=996dc435786b1dc4db180dba570f2f3f439698f5;p=features.git Minimal support for systems with input method (CJK). * GuiWorkArea::inputMethodEvent(): process a keyPressEvent() for each character of the commitString(). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17134 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiWorkArea.C b/src/frontends/qt4/GuiWorkArea.C index dbfe010f14..af218a8886 100644 --- a/src/frontends/qt4/GuiWorkArea.C +++ b/src/frontends/qt4/GuiWorkArea.C @@ -575,14 +575,23 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e) << 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(); }