这里是common+shift+鼠标右键连续点击5次
DefWeakSelf
self.debugMonitorEvent = [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskRightMouseDown | NSEventMaskKeyDown | NSEventMaskFlagsChanged handler:^NSEvent * _Nullable(NSEvent * _Nonnull event) {
BOOL isKeyWindow = weakSelf.window.isKeyWindow;
BOOL isActive = [NSRunningApplication currentApplication].active;
if (isKeyWindow && isActive) {
if (((event.modifierFlags & NSEventModifierFlagCommand) != 0 && (event.modifierFlags & NSEventModifierFlagShift) != 0)) {
if (event.type == NSEventTypeRightMouseDown) {
if (weakSelf.mouseClickCount < 5) {
weakSelf.mouseClickCount++;
}
if (weakSelf.mouseClickCount >= 5) {
weakSelf.mouseClickCount = 0;
[LSChangePlatformHelper showChangeServiceAlertWithWindow:weakSelf.window];
}
}else {
weakSelf.mouseClickCount = 0;
}
}else {
weakSelf.mouseClickCount = 0;
}
}else {
weakSelf.mouseClickCount = 0;
}
return event;
}];
网友评论