Re: NSControlTextDidChangeNotification - What key pressed?
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