Results 1 to 6 of 6

Thread: IME for Clanlib Text Box

  1. #1

    Default IME for Clanlib Text Box

    I have been playing around with Clanlib 2.0 recently, I really like it(good work, clanlib team ). I also have tried displaying Asian languages on Clanlib 2.0, it works very well with unicode enabled, the only issue I couldn't make it work is getting IME input text for the input text box. Does anyone know how do make the Clanlib GUI text box to receive IME input? Any help is appreciated.

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    I committed a fix for dead keys last night. Perhaps this also fixes any problem with Asian keyboards?

    If latest SVN of 2.0 does not fix this issue, then I'm afraid you'll have to help explain how IME works. As the ignorant European I am, I just don't know.

  3. #3

    Default

    Thanks Magnus. I've tried to access Clanlib SVN quite a couple of times these few days but have no success. The error message I received was "Connected host has failed to respond".

  4. #4
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    Hmm, there must be some firewall somewhere blocking your access or something.

    I made a zip file for you to test, if you still can't get SVN to work:

    http://esoteric.clanlib.org/~mbn/tem...17-08-2009.zip

  5. #5

    Default

    Thanks Magnus. I've tested the IME input with the Clanlib2 version you provided, IME input is still not working with the Clanlib GUI. There is one small difference I've noticed for the SVN version and the current official release(2.0.3). When I use the SVN version of Clanlib, the IME candidate window is not even shown while I'm typing characters using IME(it's shown with current release of Clanlib).

    The following briefly shows the windows IME elements/interfaces that may help to understand what I'm talking about :


    This is one of the most detailed pages about IME application development(as well as introduction of IME) I've found :
    http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

    I'm not familiar with developing IME-aware application, but I'll still try to look at the UI code of the clanlib to see if there is anything I can help to it work.

  6. #6
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    OK, my understanding from reading this overview document is that when you press the IME button, TranslateMessage generates a certain WM_CHAR message. This message then reaches DefWindowProc. The IME code in Windows then creates the IME windows, which can be quite complex depending on the language and IME software installed. Finally, when the intended character is chosen, the IME code sends a WM_CHAR to the application.

    This design has two problems.

    One is that ClanLib does not use TranslateMessage and WM_CHAR because our CL_InputEvent structure does not have an 'character' input type. We only have a 'pressed' and 'released', where we pass along in the 'pressed' which characters should be generated. We could solve this by introducing a 'character' input event type in ClanLib, but then our X11/OSX targets may have to simulate such a type.

    The other problem is that the TranslateMessage+DefWindowProc design does not work in fullscreen DirectX! To support IME in such scenarios we would have to do the same thing as the DXUT library and create our own GUI components for IME editing. Unfortunately it seems that not all the IME editors can be created this way (according to the MS overview document).

    This puts us in a bit of a problematic situation, since the first method is preferable for a system WM based clanGUI application because we get to support all IME editors. But since it does not work for a texture WM based fullscreen game, the DXUT approach is the only way there but it is not preferable for system WM apps.

    Input handling in Windows is such a mess.

Similar Threads

  1. When drawing text, crash while clearing the screen!?
    By Iori Branford in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 01-05-2007, 10:56 PM
  2. New Day Text
    By File Sponge in forum Funeral Quest
    Replies: 2
    Last Post: 08-29-2006, 05:30 AM
  3. New Day text
    By File Sponge in forum Funeral Quest
    Replies: 0
    Last Post: 10-16-2005, 11:13 PM
  4. Bug: Big text in TLM on laptop
    By mrbrown in forum Other RTsoft Games
    Replies: 5
    Last Post: 09-03-2002, 03:04 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •