• 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: KeyDown Events in NSImageView Subclass?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: KeyDown Events in NSImageView Subclass?


  • Subject: Re: KeyDown Events in NSImageView Subclass?
  • From: matt neuburg <email@hidden>
  • Date: Tue, 17 Dec 2002 11:32:40 -0800

On Mon, 16 Dec 2002 12:46:56 -0800, Richard Jackson <email@hidden> said:

>
> I have a subclass of NSImageView where I would like to
> receive KeyDown
>events (I want to be able to use the "arrow" keys to move
>a cursor around my image). I've overridden
>acceptsFirstResponder: to return YES - and I see it get
>called, but I never get keyDown messages (instead I get a
>"purr" sound when I press a key, which I assume means
>"nobody home"...?). I've tried making myImageView "first
>responder", but still no luck.

Just because acceptsFirstResponder returns YES does not mean the instance will ever become first responder. First of all, becomeFirstResponder must also return YES. Second, you must have a mechanism for telling the window to actually make this instance first responder. If you do both of those things I guarantee it will work just fine. m.

matt neuburg, phd = email@hidden, http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Using image as a mask
  • Next by Date: Subject: Re: "First Run" installation of Application support stuff?
  • Previous by thread: RE: KeyDown Events in NSImageView Subclass?
  • Next by thread: Printing examples in Cocoa
  • Index(es):
    • Date
    • Thread