• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSControlTextDidChangeNotification - What key pressed?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSControlTextDidChangeNotification - What key pressed?


  • Subject: Re: NSControlTextDidChangeNotification - What key pressed?
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 3 Sep 2009 13:18:27 -0700


On Sep 3, 2009, at 1:03 PM, email@hidden wrote:

I added an NSControlTextDidChangeNotification for a text field and I was wondering if there is a way to see what key was pressed when the selector is called?

Nope — this notification is higher level and happens after any user- driven change; it's not directly related to a particular input event. Text can be changed without keystrokes. For example, the user might have used drag-and-drop to insert or move text in the field, without any keystroke at all. Or they might have used mouse clicks in an input- method panel to create a CJK character.


What precisely are you trying to do? If you really need to look at every keystroke, you'll probably have to override keyDown:, but this is tricky to do because the view you have to override it in is the window's field editor, not the control itself.

—Jens_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSControlTextDidChangeNotification - What key pressed? (From: email@hidden)

  • Prev by Date: RE: NSServices
  • Next by Date: Re: NSControlTextDidChangeNotification - What key pressed?
  • Previous by thread: NSControlTextDidChangeNotification - What key pressed?
  • Next by thread: Re: NSControlTextDidChangeNotification - What key pressed?
  • Index(es):
    • Date
    • Thread