Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I get a notification each time a EditText control contents changes?





Marco Piovanelli wrote:
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).
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: How do I get a notification each time a EditText control contents changes? (From: Eric Schlegel <email@hidden>)
 >Re: How do I get a notification each time a EditText control contents changes? (From: "B.J. Buchalter" <email@hidden>)
 >Re: How do I get a notification each time a EditText control contents changes? (From: "Marco Piovanelli" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.