Re: post hidden mouse events
Re: post hidden mouse events
- Subject: Re: post hidden mouse events
- From: email@hidden (Tom Marchand)
- Date: Thu, 03 May 2007 13:47:11 +0000
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