• 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: Paste with no Edit Menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Paste with no Edit Menu


  • Subject: Re: Paste with no Edit Menu
  • From: Development Staff <email@hidden>
  • Date: Wed, 11 Feb 2009 21:54:23 -0500

You want to subclass NSWindow and override -sendEvent:, which will let you get at the keyboard events before the rest of the standard event handling stuff gets at it. You will use your subclass of NSWindow for your windows.

Alternately you could subclass NSApp and override -sendEvent: there. I did something similar by subclassing NSWindow, but you may find that you need to hijack the event earlier in the process (e.g. at NSApp). Try both ways.

See http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/EventOverview/Introduction/chapter_1_section_1.html for details, specifically the section on Event Dispatch.

On Feb 11, 2009, at 2:28 PM, Andy Bell wrote:

Hi All,

I am working on a project which is an Agent and just has a couple on Windows
and a menu bar icon. The menu bar icon has a menu which is used to call up
the two windows. Now I want to add 'Command-V' so that I can paste into the
NSTextFields in this window, as I don't have the standard Edit menu I need
to catch this command in some other way. I did first try to add a menu item
for pasting in the menu bar menu and hooking it into the First responder
paste selector but that didn't work. Any ideas?


Thanks in advance
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


Jeffrey Dutky Senior Software Engineer Medhavi Software Inc. email@hidden

_______________________________________________

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: 
 >Paste with no Edit Menu (From: Andy Bell <email@hidden>)

  • Prev by Date: Re: Application Architecture or approach
  • Next by Date: How do I make one thread wait until another thread exits?
  • Previous by thread: Paste with no Edit Menu
  • Next by thread: Re: Paste with no Edit Menu
  • Index(es):
    • Date
    • Thread