How to imitiate mouse move programmatically? [NSApp postEvent:atStart:] does not work...
How to imitiate mouse move programmatically? [NSApp postEvent:atStart:] does not work...
- Subject: How to imitiate mouse move programmatically? [NSApp postEvent:atStart:] does not work...
- From: Oleg Krupnov <email@hidden>
- Date: Tue, 3 Nov 2009 11:03:10 +0200
Hi,
I'd like to imitate a mouse move event programmaticaly, to refresh the
state of my custom view.
What is the best way to do it?
I am trying to use [NSApp postEvent:atStart:] and [window
postEvent:atStart:], but nothing happens, the event is not fired, and
the view does not receive it.
Here is my code:
NSEvent* event = [NSEvent mouseEventWithType:NSMouseMoved
location:windowPoint
modifierFlags:0
timestamp:0
windowNumber:windowNumber
context:nil
eventNumber:0
clickCount:0
pressure:0];
[NSApp postEvent:event atStart:NO];
What am I doing wrong? Thanks!
_______________________________________________
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