How may I monitor all gestures of the entire system

Posted by Jiulong Zhao on Super User See other posts from Super User or by Jiulong Zhao
Published on 2012-03-23T23:23:20Z Indexed on 2012/03/23 23:32 UTC
Read the original article Hit count: 258

Filed under:
|
|

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.

© Super User or respective owner

Related posts about monitor

Related posts about events