Re: CGEventTap locks up entire system
Re: CGEventTap locks up entire system
- Subject: Re: CGEventTap locks up entire system
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 01 Sep 2008 18:39:14 -0400
- Thread-topic: CGEventTap locks up entire system
on 2008-09-01 3:05 PM, Erik Aigner at email@hidden wrote:
> im using CGEventTap to prevent iTunes from getting the media key
> events. This works all fine, but however... when i click something on
> the UI of my application the entire system UI freezes - game over.
>
> Why is this happening?
>
> (the event tap callback seems not to be called when i click on a ui
> control of my app. threading issue?)
It's very easy to freeze up your entire system while developing an
application that uses event taps to intercept global hardware events. If
you're intercepting events then passing them along only if a test is
satisfied, I recommend creating a passive event tap until you're sure you've
got everything else working right. Then turn the tap into an active event
tap and hope for the best. Try to leave some kinds of events untapped during
development, so you can still, for example, press Command-Q to quit your app
-- which should automatically uninstall the tap and bring your machine back
to life.
Playing with my free Event Taps Testbench might help you figure out what the
issue is. Let me know privately if it does help -- or better yet if it
doesn't help and you can tell me why not. I would like to make it as useful
as possible to developers working with event taps.
<http://prefabsoftware.com/eventtapstestbench>.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com
PreFab Software - www.prefabsoftware.com
_______________________________________________
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