On Thursday 19 December 2002 8:40 am, Shigeru Miyata wrote: > Angus Leeming <[EMAIL PROTECTED]> wrote: > > As an aside, I also believe that this could be made to work with cghan's > > stuff because every composed char has a unique keysym. (Am I right here?) > > That means fl_XLookupString could be modified to work with far eastern > > languages and everything else will continue to work. Note that this > > thought is pure speculation ;-)
> OK. Here are some observations: Thanks for the feedback Miyata. It would seem that I've got lots to think about. I would really like to get this working in the right way and in the right place (ie, in xforms itself). One thing that I have got from my digging is a better understanding of xforms insides, so that is definitely a good thing. > > - for (ch = keybuf; ch < (keybuf + kbuflen) && keyform; ch++) > > - fl_handle_form(keyform, formevent, *ch, xev); > that is, Input Method server might send an event with multibyte string > in keybuf and kbuflen > 1 to xforms, and xforms divides it into pieces > of 1 byte keysym events and send them one by one to LyX. Naturally, > their timestamps are all the same. Your patch to xforms > > + /* Dispatch the key event */ > > + fl_handle_form(keyform, formevent, keysym, xev); > is of course wrong! since keysym can contain only 1 byte. Ummmm. I would say that the current scheme (passing a multibyte string char by char) is horrible. Comparing timestamps is just a kludge. Surely, what we need is a way of passing the multibyte string as a multibyte string. Something like: if (kbuflen > 1) fl_handle_multibyte_string(keyform, formevent, keybuf, kbuflen, xev) else fl_handle_form(keyform, formevent, keysym, xev); The advantage of passing keysym over a single char is transparency. XK_Escape is immediately understandable. Please comment on this! > As I already said, XIMPreeditNothing|XIMStatusNothing style xforms set > for Input Context is extremely inconvenient for Japanese input and I > wish xforms at least tries to > XSetICValues(fl_context->xic, XNInputStyle, > XIMPreeditPosition|XIMStatusNothing, NULL); > on the created Input Context. I'm not sure but I guess this call > gracefully fails with non-CJK input method without affecting the > behaviour. This is a separate problem from finding the best way to pass a multibyte string to the widgets. I'm willing to do the work but will need some considerable guidance as I get stuck. Would you both be willing to point me in the correct direction? -- Angus