#793 Japanese text input problem (patch available)

None
fixed
nobody
None
1
2013-08-26
2013-08-19
Yuuto Tokunaga
No

I'm an linux user. When I input Japanese text in the editor with ibus (input method framework for linux), I can't see any preedit text on screen. After I pressed enter to settle preedit text, I can see what I wrote.
I tried to fix this problem and I found QEditor::inputMethodEvent function in qcodeedit/lib/qeditor.cpp. I found a part of this function isn't work due to #ifdef Q_WS_MAC. Codes between #ifdef Q_WS_MAC and #endif only works on Mac OS.
After a bit coding and debugging, I fixed this problem. I checked that Japanese input works good on Kubuntu.

But I can't understand why the code is disabled by #ifdef Q_WS_MAC. Is there any reason?

patch is here : http://pastebin.ubuntu.com/6002384/

1 Attachments

Discussion

  • how does "kate" handle japanese inputs ?
    The issue is that i did not want txs to feel differently from standard programs.

    why is "e->accept()" necessary ?
    when is the extra if(...) necessary ?

     
    • Yuuto Tokunaga
      Yuuto Tokunaga
      2013-08-20

      I wrote this patch following kate 4.10.5 source code.
      I found e->accept() at the end of KateViewInternal::inputMethodEvent(QInputMethodEvent* e) function, so I added it.
      Extra if(...) is needed when the text is deleted by Backspace key or input canceled by Esc key. Without this code, you find that text isn't deleted after you canceled input by pressing Esc key.
      When you press Esc key, IME send QInputMethodEvent e that includes empty preeditString and empty commitString, but inputMethodEvent function can't handle this so the text isn't deleted.

       
  • okay, implemented in svn.
    Let's see if any problems arise ...

     
    • status: open --> fixed
    • Group: -->
     
  • seems to work