我需要在Mac OS X中触发手势事件。我发现了这个问题: Is there a way to trigger gesture events on Mac OS X? 它适用于我,但如果我想改变旋转?例如,
- (void)rotateWithEvent:(NSEvent *)event {
NSLog(@"ROTATE: %f", [event rotation]);
}
-(IBAction)button:(id)sender {
...
CGEventSourceRef eventSource = CGEventSourceCreate(kCGEventSourceStateCombinedSessionState);
CGEventRef event = CGEventCreate(eventSource);
CGEventSetType(event, NSEventTypeRotate);
CGEventPost(kCGHIDEventTap, event);
...
}
将记录
ROTATE: 0.0
我正在寻找如何改变旋转,但没有找到任何东西...... 谢谢你的帮助。