• 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: Delete action from variety of key presses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delete action from variety of key presses


  • Subject: Re: Delete action from variety of key presses
  • From: Graham Cox <email@hidden>
  • Date: Tue, 8 Jul 2008 10:07:03 +1000

The view that is first responder needs to override -keyDown: and do this:

	[self interpretKeyEvents:[NSArray arrayWithObject:event]];

which hooks the event into the standard dispatcher for these methods.

(One thing that has long puzzled me about this though - why is the parameter an array of events when only one event is ever available?)


hth,

Graham



On 8 Jul 2008, at 9:59 am, Nathan Vander Wilt wrote:

The Cocoa Text Bindings system already translates keys and key combinations into invocations of NSResponder methods. <http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/chapter_9_section_1.html >

So, what you need to do is determine which methods those keys are already mapping to, override those methods in the appropriate place in your responder chain (e.g. on your custom view or application delegate), and have them all invoke some common method to do what you want.

Thanks, I forgot to mention that I tried overriding some of those action methods. However, I couldn't get them to fire.

_______________________________________________

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: Delete action from variety of key presses
      • From: Nathan Vander Wilt <email@hidden>
    • Re: Delete action from variety of key presses
      • From: Randall Meadows <email@hidden>
References: 
 >Delete action from variety of key presses (From: Nathan Vander Wilt <email@hidden>)
 >Re: Delete action from variety of key presses (From: Ken Thomases <email@hidden>)
 >Re: Delete action from variety of key presses (From: Nathan Vander Wilt <email@hidden>)

  • Prev by Date: Re: Delete action from variety of key presses
  • Next by Date: Re: Delete action from variety of key presses
  • Previous by thread: Re: Delete action from variety of key presses
  • Next by thread: Re: Delete action from variety of key presses
  • Index(es):
    • Date
    • Thread