• 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: Getting a command key before it is interpreted by the menus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting a command key before it is interpreted by the menus


  • Subject: Re: Getting a command key before it is interpreted by the menus
  • From: Eric Schlegel <email@hidden>
  • Date: Fri, 23 Apr 2004 08:10:26 -0700

On Apr 23, 2004, at 7:23 AM, Gideon King wrote:

Hi, I have a situation in my application where I would like to intercept command key combinations before they are processed by the menu system. In the archives, people say to override NSApplication's sendEvent: method. This works if the menu is not currently open, but if the user has the menu open, the command key events never make it to sendEvent: I looked at the documentation and saw NSMenuView, and thought I could override keyDown: there, but then I noticed that the documentation says that it is obsolete and no longer used, but it doesn't say what it has been replaced with. I see references in other postings to a carbon menu manager, but don't see how to get at that or how to interact with it in my app.

My goal is to be able to intercept all command key combinations when the menu is open, and decide in my code whether to pass them on to the menu system or whether to process them separately in my code.

Unfortunately I don't think there's any way to do that. The keydown event will be grabbed by the Menu Manager during menu tracking and processed as a command key before it gets sent to any part of the application.

-eric
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Getting a command key before it is interpreted by the menus
      • From: Nicko van Someren <email@hidden>
References: 
 >Getting a command key before it is interpreted by the menus (From: Gideon King <email@hidden>)

  • Prev by Date: Re: Getting a command key before it is interpreted by the menus
  • Next by Date: Re: [OT] Algebra (was: Re: Is Concatenation that complex?)
  • Previous by thread: Re: Getting a command key before it is interpreted by the menus
  • Next by thread: Re: Getting a command key before it is interpreted by the menus
  • Index(es):
    • Date
    • Thread