- NSRect screenRect = [[NSScreen mainScreen] frame];
- NSInteger height = screenRect.size.height;
- NSPoint mouseLoc = [NSEvent mouseLocation];
- CGEventType eventType = (which == kCGMouseButtonLeft) ? kCGEventLeftMouseDown : kCGEventRightMouseDown;
+ CGFloat height = NSScreen.mainScreen.frame.size.height;
+ NSPoint mouseLoc = NSEvent.mouseLocation;
+ CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseDown : kCGEventRightMouseDown;