This Question is Assumed Answered

1 "correct" answer available (5 pts) 14 "helpful" answers available (3 pts)
1 Replies Last post: Jul 31, 2008 7:48 PM by carl

About KeyPress event?

Jul 31, 2008 6:34 PM

Click to view markecho's profile Level 2 markecho 35 posts since
Oct 17, 2007

Hi,
When I input Japanese character --- hiragana, I want to fire the KeyPress event.

for example:
When I input the "あ" in the TextField,the KeyPress event is fired.
How should I do?

thanks a lot :-)

Click to view carl's profile Curl carl 83 posts since
Oct 17, 2007
1. Re: About KeyPress event? Jul 31, 2008 7:48 PM
I believe it's a bit more complicated than that. IME is often more a stateful build-and-commit process than a collection of individual insertable keys.

If you want to handle individual composition changes, you can look at CompositionChangeEvent. Note that these events are delivered to a control's UI, not the control itself. So, for example, the following would dump out the current value under composition in a TextFieldUI:

{ui.add-event-handler
    {on e:CompositionChangeEvent at tfui:TextFieldUI do
        {dump e, e.string}
    }
}