// Enjoy
//
// Created by Yifeng Huang on 7/27/12.
-// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "TargetMouseBtn.h"
}
-(void) trigger {
- NSRect screenRect = [[NSScreen mainScreen] frame];
- CGFloat height = screenRect.size.height;
- NSPoint mouseLoc = [NSEvent mouseLocation];
+ CGFloat height = NSScreen.mainScreen.frame.size.height;
+ NSPoint mouseLoc = NSEvent.mouseLocation;
CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseDown : kCGEventRightMouseDown;
CGEventRef click = CGEventCreateMouseEvent(NULL,
eventType,
}
-(void) untrigger {
- NSRect screenRect = [[NSScreen mainScreen] frame];
- CGFloat height = screenRect.size.height;
- NSPoint mouseLoc = [NSEvent mouseLocation];
+ CGFloat height = NSScreen.mainScreen.frame.size.height;
+ NSPoint mouseLoc = NSEvent.mouseLocation;
CGEventType eventType = (_button == kCGMouseButtonLeft) ? kCGEventLeftMouseUp : kCGEventRightMouseUp;
CGEventRef click = CGEventCreateMouseEvent(NULL,
eventType,