• 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: capturing special keys when focused in an NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: capturing special keys when focused in an NSTextField


  • Subject: Re: capturing special keys when focused in an NSTextField
  • From: Jens Alfke <email@hidden>
  • Date: Sat, 10 Oct 2009 15:06:27 -0700


On Oct 10, 2009, at 1:13 PM, aaron smith wrote:

Quick question - I have a window that I run as a sheet, which contains
an NSTextField to enter a message. I have the window setup to close
the sheet when the Escape key is pressed, however, when the text field
is focused I can't figure out how to respond to these types of special
keys.

IIRC, this event gets handled by the button's -performKeyEquivalent: method, before normal key processing. You could override that method in another view to handle the Esc key, but it would probably need to be an ancestor view of the button. It might be easier just to clear the button's key equivalent property when the text view gets focus and restore it afterwards.


—Jens_______________________________________________

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: 
 >capturing special keys when focused in an NSTextField (From: aaron smith <email@hidden>)

  • Prev by Date: Re: real verses Virtual memory
  • Next by Date: Re: real verses Virtual memory
  • Previous by thread: capturing special keys when focused in an NSTextField
  • Next by thread: Re: Drawing NSImageView Over NSOpenGLview
  • Index(es):
    • Date
    • Thread