I\'ve been using CGPostMouseEvent() for performing mouse clicks since mac os 10.4.
While working on my code and trying to make it 100% compatible with Snow Leopard,
CGEventCreateMouseEvent
can be used with CGEventPost
in a non-deprecated fashion. The reference is here.
Edit from OP:
Something like this?
void PostMouseEvent(CGMouseButton button, CGEventType type, const CGPoint point)
{
CGEventRef theEvent = CGEventCreateMouseEvent(NULL, type, point, button);
CGEventSetType(theEvent, type);
CGEventPost(kCGHIDEventTap, theEvent);
CFRelease(theEvent);
}