• 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: Intercepting keyDown event from NSComboBox
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Intercepting keyDown event from NSComboBox


  • Subject: Re: Intercepting keyDown event from NSComboBox
  • From: "Kyle Sluder" <email@hidden>
  • Date: Tue, 12 Feb 2008 20:23:02 -0500

On 2/12/08, Randall Meadows <email@hidden> wrote:
> Is there a better way to intercept keyDown events before the
> firstResponder gets a whack at it?  (Assume that changing the actual
> UI/UE, at this point, is not an option.)

According to the Cocoa Event-Handling Guide, NSApplication receives
incoming events from the window server, and finds the approrpiate
window to handle the event.  It then gives the event to the window,
which sends it to its first responder:

http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/chapter_2_section_3.html#//apple_ref/doc/uid/10000060i-CH3-SW4

The short answer: override -[NSWindow sendEvent:] and capture the
event before it gets dispatched to the first responder.

--Kyle Sluder
_______________________________________________

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: 
 >Intercepting keyDown event from NSComboBox (From: Randall Meadows <email@hidden>)

  • Prev by Date: Re: NSURLConnection details
  • Next by Date: Re: Intercepting keyDown event from NSComboBox
  • Previous by thread: Intercepting keyDown event from NSComboBox
  • Next by thread: Re: Intercepting keyDown event from NSComboBox
  • Index(es):
    • Date
    • Thread