Re: How to imitiate mouse move programmatically? [NSApp postEvent:atStart:] does not work...
Re: How to imitiate mouse move programmatically? [NSApp postEvent:atStart:] does not work...
- Subject: Re: How to imitiate mouse move programmatically? [NSApp postEvent:atStart:] does not work...
- From: Oleg Krupnov <email@hidden>
- Date: Tue, 3 Nov 2009 14:59:52 +0200
Dave, I already tried CGEventPost() but it does not seem to work
either -- just nothing happens. I'd appreciate an example of working
code, I haven't been able to find any.
I also tried CGPostMouseEvent(). This works, but in a weird way -- it
actually moves the mouse cursor (kind of a too low-level thing), which
is not my intention, but even despite that, the corresponding mouse
moved event still does not occur in the NSApp, which puzzles me.
Besides I heard this function is deprecated in Snow Leopard, so I'd
not like to use it.
Thanks
On Tue, Nov 3, 2009 at 2:33 PM, Dave Keck <email@hidden> wrote:
> Untested suggestion: when a real mouse moved event occurs, NSLog it
> and duplicate its arguments exactly. Perhaps the '0' arguments are why
> it's not working.
>
> If that doesn't do the trick, you'll probably have to drop to a lower
> level, such as CGEventPost().
>
> ... but Graham's right - there's probably a better way :)
>
_______________________________________________
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