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
This commit is contained in:
Abdelrazak Younes 2007-02-10 16:30:11 +00:00
parent 7e1920c5dc
commit 996dc43578

View File

@ -575,14 +575,23 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
<< endl; << endl;
int key = 0; int key = 0;
// FIXME Abdel 10/02/07: Remove?
// needed to make math superscript work on some systems // needed to make math superscript work on some systems
// ideally, such special coding should not be necessary // ideally, such special coding should not be necessary
if (text == "^") if (text == "^")
key = Qt::Key_AsciiCircum; 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. // FIXME Abdel 10/02/07: Minimal support for CJK, aka systems
QKeyEvent ev(QEvent::KeyPress, key, Qt::NoModifier, text); // with input methods. What should we do with e->preeditString()?
keyPressEvent(&ev); // 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(); e->accept();
} }