I'm using the following code to simulate a click of the mouse: void PostMouseEvent(CGMouseButton button, CGEventType type, const CGPoint …