[Uim] Re: question about function uim_reset_context()

Mike FABIAN mfabian at suse.de
Sat Dec 18 03:56:54 EET 2004


TOKUNAGA Hiroyuki <tkng at xem.jp> さんは書きました:

>> What must be added to uim_reset_context() to make it really
>> commit the pending preedit string and then erase it?

[...]

> First, what you want to do is 'commit when switch off', not 'commit when
> focus out', OK?

Yes. I don't much care whether the preedit string is commited on
focus out but I would like to commit it on switch off.

> Personally I dislike the idea of on/off mode, but I can understand that.
> I agree with you, preedit strings should be committed when input method
> is disabled. But I don't think preedit strings should 'always' be
> commited when input method is 'focused out'. That's only my opinion, you
> may not agree.

I think we agree. It doesn't really matter on focus out but when
switch off the preedit string should be commited.

> In this mail, I want to write 2 things, the most ugly hack to commit
> preedit strings and about semantic of reset.
>
> The most ugly hack is that:
>
>    if(there_is_preedit)
>       rv = uim_press_key(context, UKey_Return, NULL);

Ha! Iwai San and me already tried this most ugly hack and found that
this works as desired but we thought that this cannot be the correct
way of doing it. After all the key binding to do the commit is
configurable, it doesn't have to be "return" always, I think
it is Control-J for some input methods.

So I kept searching for a real commit function.

> instead of calling reset function. In most case, this will work. You
> know, uim doesn't have explicit commit function.

But now you confirm that there isn't such a thing in uim, I was
already starting to wonder why I couldn't find it.

> If we want to add the explicit commit function to uim, we have to
> extend all input methods of uim. Becausein uim, preedit strings !=
> commited strings and there is no way to know commit strings until
> commit_cb is called.

That is also what surprised me, I couldn't find a way to get the
string to commit. I thought that I just didn't find it but now you say
that there really is no way to know the commit string before the
callback is called.

> Below from this line is about the future of uim.
>
> * semantic of reset
>
> Determination of semancic of reset is difficult problem, so uim doesn't
> have the policy about reset function (for now). A input method may
> commit preedit strings, then may erase preedit strings. Another input
> method may hold preedit strings (do nothing). For now, most of input
> methods don't implement reset function. Obviously we should define the
> policy about reset functionality.
>
> Now I'm thinking that
>  - Preedit string should be commited when reset function called

Yes.

>  - Focus out should not call reset function

OK with me, I don't much care about focus out.

>  - Instead of caling reset function, focus in/out function of input
> method should be called. 
>
> If you agree/disagree this, please reply.
>
>
> My explanation would not be enough, but that's my best for now. (I'm
> very sleepy, now 5:00 A.M. in Japan... 睡眠不足はいい仕事の敵だ!) So if
> you have any question, please send a mail to me.

I'll be offline until Monday now.

I hope you have a nice weekend!

-- 
Mike FABIAN   <mfabian at suse.de>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。



More information about the uim mailing list