I want to trigger multitouch gesture events on Mac OS X. Is there a way to do this? Mouse or keyboard events can be triggered with CGEventCreateMouseEvent and CGEventCreateKeyboardEvent. Is there similar low level function for multitouch events?
Rok
Your suggestion is not working. I've tried this code:
- (void)rotateWithEvent:(NSEvent *)event {
NSLog(@"ROTATE");
}
-(IBAction)button:(id)sender {
CGEventSourceRef eventSource = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState);
CGEventRef event = CGEventCreate(eventSource);
CGEventSetType(event, NSEventTypeRotate);
CGEventPost(kCGHIDEventTap, event);
NSLog(@"POST EVENT");
}
But function rotateWithEvent never gets called. Am I doing something wrong?