[NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskLeftMouseDown | NSEventMaskRightMouseDown | NSEventMaskMouseMoved handler:^NSEvent* (NSEvent* event) {
return event;
}];
[NSEvent addGlobalMonitorForEventsMatchingMask:NSEventMaskLeftMouseDown | NSEventMaskRightMouseDown | NSEventTypeKeyDown | NSEventMaskMouseMoved handler:^(NSEvent * _Nonnull event) {
[self globalMonitorEvent:event];
}];
网友评论