On czwartek 19 grudzień 2002 10:29 am, Angus Leeming wrote: > On Thursday 19 December 2002 12:57 pm, Angus Leeming wrote: > > > > - 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. > > I've just re-read this and think I should make myself clearer. I really > think that > fl_handle_form(..., keysym, xev); > is prefereable to > fl_handle_form(..., keybuf[0], xev);
I think that they keysym way is in fact the only sensible way. Maybe xforms could be modified to support both ways not to break the ABI and support older code that still depends on it? So, if my assumption that fl_handle_form is a callback, one could either invoke fl_handle_form(..., char, xev) or say fl_handle_form_sym(..., keysym, xev) depending on which callback was registered. I hope it's that simple (my knowledge of xforms is basically "duh?"). Cheers, Kuba Ober