Hi list!

I'm attempting to simulate mouse clicks (I already tried accessibility API, but I'm clicking on a flash movie in Safari, so it's not a standard UI element and doesn't work). I've got it working, unless I set x to a negative number to click on my second monitor, in which case, the mouse clicks on the left edge of my primary monitor at the correct y.

CGPoint pt;
  pt.x = x;
  pt.y = y;
        
CGEventRef down_event = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseDown, pt, 0); CGEventRef up_event = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseUp, pt, 0);
        
        CGEventPost(kCGHIDEventTap, down_event);
        CGEventPost(kCGHIDEventTap, up_event);
        
        CFRelease(down_event);
        CFRelease(up_event);

Thanks!

Sean DeNigris
[email protected]



_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to