• 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: Cocoa equivalent for 'InstallApplicationEventHandler'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa equivalent for 'InstallApplicationEventHandler'


  • Subject: Re: Cocoa equivalent for 'InstallApplicationEventHandler'
  • From: Uli Kusterer <email@hidden>
  • Date: Sat, 20 Feb 2010 13:08:14 +0100

On 20.02.2010, at 12:53, Tom Davie wrote:
> You want NSEvent's
>
> + (id)addGlobalMonitorForEventsMatchingMask:(NSEventMask)*mask* handler:(void
> (^)(NSEvent*))*block*
> *and*
> *
>
> + (id)addLocalMonitorForEventsMatchingMask:(NSEventMask)mask handler:(NSEvent*
> (^)(NSEvent*))block

 Nope, that's the wrong choice. This would give him copies of events sent to *other* applications as well (hence the "global").

 The sendEvent override seems like the most workable solution to me so far. Though I'd suggest not doing the work directly in your application instance. Instead, forward the event to your delegate. That way, you can use the same NSApplication subclass in your other apps.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://groups.yahoo.com/group/mac-gui-dev/

_______________________________________________

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: Cocoa equivalent for 'InstallApplicationEventHandler'
      • From: Jesper Storm Bache <email@hidden>
References: 
 >Cocoa equivalent for 'InstallApplicationEventHandler' (From: Vikram Sethi <email@hidden>)
 >Re: Cocoa equivalent for 'InstallApplicationEventHandler' (From: Tom Davie <email@hidden>)

  • Prev by Date: Re: Cocoa equivalent for 'InstallApplicationEventHandler'
  • Next by Date: Re: Monitoring other application preferences changes
  • Previous by thread: Re: Cocoa equivalent for 'InstallApplicationEventHandler'
  • Next by thread: Re: Cocoa equivalent for 'InstallApplicationEventHandler'
  • Index(es):
    • Date
    • Thread