Index: src/Plugins/Freetype/tt_file.cpp
===================================================================
--- src/Plugins/Freetype/tt_file.cpp	(revision 3101)
+++ src/Plugins/Freetype/tt_file.cpp	(working copy)
@@ -45,7 +45,7 @@
     //cout << "tt_locate: " << name << " -> " << u << "\n";
     if (!is_none (u)) return u;
   }
-  else if (use_locate &&
+  else if (//use_locate &&
 	   // NOTE: avoiding unnecessary locates can greatly improve timings
 	   !starts (name, "ec") &&
 	   !starts (name, "la") &&
Index: src/Plugins/Qt/QTMWidget.cpp
===================================================================
--- src/Plugins/Qt/QTMWidget.cpp	(revision 3101)
+++ src/Plugins/Qt/QTMWidget.cpp	(working copy)
@@ -158,6 +158,7 @@
   QAbstractScrollArea::viewport()->setMouseTracking (true);
   QAbstractScrollArea::viewport()->setFocusPolicy (Qt::StrongFocus);
   backing_pos = origin;
+  setAttribute(Qt::WA_InputMethodEnabled, true);
 }
 
 
@@ -498,6 +499,34 @@
   }
 }
 
+void
+QTMWidget::inputMethodEvent (QInputMethodEvent* event) {
+  simple_widget_rep *wid =  tm_widget();
+  if (!wid) return;
+  
+  QString nss = event->commitString();
+  if (DEBUG_QT)
+    cout << "inputMethodEvent: commitString length = " << nss.length() << "\n";
+  QByteArray buf= nss.toUtf8();
+  string rr (buf.constData(), buf.count());
+  string r= utf8_to_cork (rr); // converter.cpp
+  if (r == "<less>") r= "<";
+  if (r == "<gtr>") r= ">";
+
+  // according to the edit_interface_rep::key_press(string key) function  
+  if (contains_unicode_char (r))
+    the_gui -> process_keypress (wid, r, texmacs_time());
+  else {
+    for (int i=0; i<N(r); i++)
+      the_gui -> process_keypress (wid, r[i], texmacs_time());
+  }
+
+  event->accept();
+
+  //FIXME: still could not input some special non-CJK charactors
+  //FIXME: currently supports commitStrings but not preeditStrings
+}
+
 static unsigned int
 mouse_state (QMouseEvent* event, bool flag) {
   unsigned int i= 0;
Index: src/Plugins/Qt/QTMWidget.hpp
===================================================================
--- src/Plugins/Qt/QTMWidget.hpp	(revision 3101)
+++ src/Plugins/Qt/QTMWidget.hpp	(working copy)
@@ -55,6 +55,7 @@
   virtual void focusInEvent (QFocusEvent* event);
   virtual void focusOutEvent (QFocusEvent* event);
   virtual void keyPressEvent (QKeyEvent* event);
+  virtual void inputMethodEvent (QInputMethodEvent* event);
   virtual void mousePressEvent (QMouseEvent* event);
   virtual void mouseReleaseEvent (QMouseEvent* event);
   virtual void mouseMoveEvent (QMouseEvent* event);
