Re: CGEventTap & CGPostMouseEvent incompatibilities?
Re: CGEventTap & CGPostMouseEvent incompatibilities?
- Subject: Re: CGEventTap & CGPostMouseEvent incompatibilities?
- From: Bill Cheeseman <email@hidden>
- Date: Thu, 19 Apr 2007 11:47:55 -0400
- Thread-topic: CGEventTap & CGPostMouseEvent incompatibilities?
on 2007-04-19 11:23 AM, Giovanni Donelli at email@hidden
wrote:
> I have an application that observes mouse clicks (with an CGEventTap) and
> sporadically generates mousedowns (with CGPostMouseEvent).
>
> Whenever the EventTap is active and I generate CGPostMouseEvent (mouse up
> and down) my whole system UI freezes and I am able to return in control only
> by pressing command-option-esc (force quit).
It sounds like you've created an infinite loop. When the event tap observes
a mouse click, it generates a mouse click, which it then observes and
generates another mouse click, which it then observes and ....
It's hard to tell, because you haven't precisely described what the event
tap is observing (mouse down? mouse up? or what?). And when you say you
generate a mouse up and mouse down event, do you really mean two events, and
in that order? Depending on what the event tap was observing and the order
of the events you generate, you may have left the mouse in an indeterminate
state.
I'm only recently getting into event taps myself, but it seems like there
are all sorts of other possibilities, like failing to use the proxy you
obtained from the event tap if you're posting events within the event tap's
callback function.
--
Bill Cheeseman
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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