You could use CGEventCreate to create a gesture event. The "officially" event types defined for CGEventCreate do not include gesture event types, but you can pass the values ββdefined in NSEvent.h :
NSEventTypeGesture NSEventTypeMagnify NSEventTypeSwipe NSEventTypeRotate NSEventTypeBeginGesture NSEventTypeEndGesture
Values ββfor non-gesture types seem to map directly to the kCGEvent<TYPE> values ββin CGEventTypes.h , so it's reasonable to expect that gesture event types will work:
CGEventSourceRef eventSource = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState); CGEventRef event = CGEventCreate(eventSource); CGEventSetType(event, NSEventTypeMagnify);
Rob keniger
source share