Publish activated/deactivated as notifications.
[enjoyable.git] / TargetMouseMove.m
index 52f241a..3ec8f38 100644 (file)
@@ -3,7 +3,6 @@
 //  Enjoy
 //
 //  Created by Yifeng Huang on 7/26/12.
-//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
 //
 
 #import "TargetMouseMove.h"
         return NO;
     }
     
-    NSRect screenRect = [[NSScreen mainScreen] frame];
-    CGFloat height = screenRect.size.height;
+    CGFloat height = NSScreen.mainScreen.frame.size.height;
     
     // TODO
     float speed = 4.f;
-    if ([jc frontWindowOnly])
+    if (jc.frontWindowOnly)
         speed = 12.f;
     float dx = 0.f, dy = 0.f;
     if (_axis == 0)
@@ -71,7 +69,7 @@
     CGEventSetIntegerValueField(move, kCGMouseEventDeltaX, (int)dx);
     CGEventSetIntegerValueField(move, kCGMouseEventDeltaY, (int)dy);
     
-    if ([jc frontWindowOnly]) {
+    if (jc.frontWindowOnly) {
         ProcessSerialNumber psn;
         GetFrontProcess(&psn);
         CGEventPostToPSN(&psn, move);