• 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: NSTextField not consuming keyDown events; How do I prevent super view from receiving those events?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSTextField not consuming keyDown events; How do I prevent super view from receiving those events?
      • From: Eric Wing <email@hidden>
References: 
 >NSTextField not consuming keyDown events; How do I prevent super view from receiving those events? (From: Eric Wing <email@hidden>)

  • Prev by Date: NSTextField not consuming keyDown events; How do I prevent super view from receiving those events?
  • Next by Date: NSDrawTiledRects Only Draws One Side
  • Previous by thread: NSTextField not consuming keyDown events; How do I prevent super view from receiving those events?
  • Next by thread: Re: NSTextField not consuming keyDown events; How do I prevent super view from receiving those events?
  • Index(es):
    • Date
    • Thread