You can use NSEvent addGlobalMonitorForEventsMatchingMask
:
define in your control:
id mouseEventMonitor;
-(id)init{
mouseEventMonitor = [NSEvent addGlobalMonitorForEventsMatchingMask:(NSLeftMouseDownMask | NSRightMouseDownMask | NSOtherMouseDownMask)
handler:^(NSEvent *event){
NSLog(@"theEvent->%@",event);
//here you will receive the all mouse DOWN events
if (event.modifierFlags & NSCommandKeyMask)
{
NSLog(@"theEvent1->%@",event);
}else{
NSLog(@"theEvent2->%@",event);
}
}];
return self;
}