• 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: Handling key equivalents in a controller class?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling key equivalents in a controller class?


  • Subject: Re: Handling key equivalents in a controller class?
  • From: Andy Lee <email@hidden>
  • Date: Thu, 17 Jul 2008 13:45:17 -0400

On Jul 16, 2008, at 2:43 PM, Kyle Sluder wrote:
Except what happens if a field editor is key?  Then the editor
swallows all keys, including Esc.  Or if it doesn't do this by
default, Esc is one of the keys that it can swallow because NSTextView
uses it as the "autocomplete" hotkey.

Didn't this question come up a while ago, and the solution was to
override the event dispatching mechanism before it even reached the
responder chain?

I don't remember the earlier question, but offhand (emphasis on "offhand") that's what I'd do. I'd add a (BOOL)handleMyKeyDown: method in a category of NSObject, and override keyDown: in NSApplication to traverse windows, delegates (perhaps including control delegates), and descendant views until something returns YES. If nothing returns YES, of course, call [super keyDown:].


--Andy

_______________________________________________

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: Handling key equivalents in a controller class?
      • From: Jens Alfke <email@hidden>
References: 
 >Handling key equivalents in a controller class? (From: Jens Alfke <email@hidden>)
 >Re: Handling key equivalents in a controller class? (From: Jeff Johnson <email@hidden>)
 >Re: Handling key equivalents in a controller class? (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: Re: IB calls Java method?
  • Next by Date: Re: notification when app is moved
  • Previous by thread: Re: Handling key equivalents in a controller class?
  • Next by thread: Re: Handling key equivalents in a controller class?
  • Index(es):
    • Date
    • Thread