Re: post hidden mouse events
Re: post hidden mouse events
- Subject: Re: post hidden mouse events
- From: "Giovanni Donelli" <email@hidden>
- Date: Thu, 3 May 2007 16:05:01 +0200
I tried that but since the click activates an other application, the
cursor becomes visible and you can see it.. it flickers, quite
disturbing in two places...
There must be a way of posting events without having the mouse moved
all over the screen.
Thank you for your reply!
On 5/3/07, Tom Marchand <email@hidden> wrote:
Is it possible to save the current mouse location, hide the cursor, post your event, set the cursor location back and then unhide the cursor?
-------------- Original message ----------------------
From: "Giovanni Donelli" <email@hidden>
> Dear Folks,
> my app needs to synthesize mouse events. To do so I have first
> used the following API:
>
> CGError CGPostMouseEvent (
> CGPoint mouseCursorPosition,
> boolean_t updateMouseCursorPosition,
> CGButtonCount buttonCount,
> boolean_t mouseButtonDown,
> ...
> );
>
> However as documentation says:
>
> "This function is not recommended for general use because of
> undocumented special cases and undesirable side effects."
>
> And it is indeed buggy as hell... there are undesirable side effects
> on some user machine, so following the documentation advice:
>
> I am using CGEventCreateMouseEvent and posting the event with CGEventPost.
>
> Now I found lots of bugs (in the API) that were discussed on this list
> already, but I did figure out finally a way to make everything work.
>
> The only issue I have with this (CGEventPost solution) is that the
> cursor also change position on the screen...
>
> Any suggestion on how I can post mouse events without updating
> MouseCursorPosition as in the CGPostMouseEvent API??? relocating the
> mouse each time after a mouse down/up operation is not an option.
>
> Thank you,
> Giovanni
> _______________________________________________
>
> 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
_______________________________________________
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
_______________________________________________
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