• 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: CGEventTap Not Receiving Events after some time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGEventTap Not Receiving Events after some time


  • Subject: Re: CGEventTap Not Receiving Events after some time
  • From: Bill Cheeseman <email@hidden>
  • Date: Thu, 30 Sep 2010 05:01:26 -0400

On Sep 29, 2010, at 3:52 PM, Erik Aigner wrote:

> When I create an event tap with  CGEventTapCreate(..) and add it to the runloop everything works as expected.
> However, after some time (I don't know what triggers this) the event tap doesn't receive events anymore, until
> I manually call CGEventTapEnable(..) again.
>
> Any clues what could cause this? Are there any notifications for status changes that i should know about?


The documentation explains that the system automatically shuts down event taps if events come so quickly that they begin to slow the system down. When this happens,  the last event you receive will be a kCGEventTapDisabled event. Test every event's event type to see whether it is a kCGEventTapDisabledByTimeout event (as opposed to a kCGEventTapDisabledByUser event, or a real event). If so, immediately re-enable the event tap, if that's what you want to do. (And don't pass this event on to other routines or act on it the way you would act on a real event.)

The documentation is the "Quartz Event Services Reference."

--

Bill Cheeseman - 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

  • Follow-Ups:
    • Re: CGEventTap Not Receiving Events after some time
      • From: Erik Aigner <email@hidden>
References: 
 >CGEventTap Not Receiving Events after some time (From: Erik Aigner <email@hidden>)

  • Prev by Date: Re: Table column alignment
  • Next by Date: Re: Button performs action and then stores result to a binding?
  • Previous by thread: CGEventTap Not Receiving Events after some time
  • Next by thread: Re: CGEventTap Not Receiving Events after some time
  • Index(es):
    • Date
    • Thread