On Mon, 12 Jun 2006 01:48:31 -0400,
B.J. Buchalter (email@hidden) wrote:
So, I can't use kEventTextDidChange cause I am targeting 10.3 too.
I have found that I need to do the following (and it appears to work OK):
For catching the text updates:
Add a { kEventClassTextInput, kEventTextInputUnicodeForKeyEvent} on the
text control. In this handler, I call CallNextEventHandler(), and then
notify my clients afterwards.
That approach will work with most western keyboards, but it may
fail to detect text entered by input methods such as Kotoeri
(the default input method for Japanese). In order to catch
characters entered via input methods, you may want to add a similar
handler for {kEventClassTextInput, kEventTextInputUpdateActiveInputArea},
and notify your clients if the kEventParamTextInputSendFixLen parameter
is non-zero.
Well, it depends if he wants to update his UI based on the
non-confirmed text input or not. I don't know for sure what other apps
should do, and it might be application-specific. I did test Spotlight
and Mail.app, and it appears that neither will run a search with
unconfirmed text—this behavior seems reasonable to me, as well, since
the contents of the unconfirmed text can change radically as you type
it (the unfinished text will usually contain characters that will not
appear in the final, confirmed text).