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 - b...@cheeseman.name _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com