]> git.lyx.org Git - features.git/commitdiff
Minimal support for systems with input method (CJK).
authorAbdelrazak Younes <younes@lyx.org>
Sat, 10 Feb 2007 16:30:11 +0000 (16:30 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 10 Feb 2007 16:30:11 +0000 (16:30 +0000)
* 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

src/frontends/qt4/GuiWorkArea.C

index dbfe010f140de3e28378b4abd06aadfd646877e3..af218a8886bcf79a87d2c209f048f9c925e46e00 100644 (file)
@@ -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();
 }