Re: NSTextField not consuming keyDown events; How do I prevent super view from receiving those events?
Re: NSTextField not consuming keyDown events; How do I prevent super view from receiving those events?
- Subject: Re: NSTextField not consuming keyDown events; How do I prevent super view from receiving those events?
- From: "email@hidden" <email@hidden>
- Date: Tue, 13 Mar 2012 23:30:30 +0000
On 13 Mar 2012, at 22:50, Eric Wing wrote:
> I have a very simple custom view where I override keyDown: and keyUp:.
>
>
> Is there a way to get the text field (and any other widgets that might
> do this like NSTextView) to consume the events they process so my
> custom view doesn't receive them?
Are you sure you aren't accidentally passing the event on up the responder chain?
- (void)keyDown:(NSEvent *)theEvent {
// consume event
if ([theEvent modifierFlags] & NSNumericPadKeyMask) {
[self processtEvent:theEvent];
}
// pass on up the responder chain
[super keyDown:theEvent];
}
Regards
Jonathan Mitchell
Mugginsoft LLP
_______________________________________________
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