How may I monitor all gestures of the entire system
- by Jiulong Zhao
I can make a view to accept touch event and receive detailed gesture event like this:
[self setAcceptsTouchEvents:YES];
//
NSSet *touches = [event touchesMatchingPhase:NSTouchPhaseBegan inView:self];
I can also receive global event by crate a monitor in this way:
NSUInteger eventMasks = NSEventTypeBeginGesture | NSEventTypeEndGesture | NSEventMaskGesture;
[NSEvent addGlobalMonitorForEventsMatchingMask:eventMasks handler:^(NSEvent *theevent) {//do something}];
But I can NOT get the detailed event from monitor by -touchesMatchingPhase
How may I monitor all gestures of the entire system.