Formal protocol for the interface shared between Joysticks and JSActions, use new...
[enjoyable.git] / TargetToggleMouseScope.m
index 4f1d157..863a35f 100644 (file)
@@ -3,7 +3,6 @@
 //  Enjoy
 //
 //  Created by Yifeng Huang on 7/28/12.
-//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
 //
 
 #import "TargetToggleMouseScope.h"
 - (void)trigger {
     // FIXME: It's hacky to get at the controller this way, but it's
     // also hacky to pass it. Shouldn't need to do either.
-    ApplicationController *ac = [NSApplication sharedApplication].delegate;
+    ApplicationController *ac = NSApplication.sharedApplication.delegate;
     JoystickController *jc = ac.jsController;
-    [jc setFrontWindowOnly: ![jc frontWindowOnly]];
-    printf("Front window only: %d\n", [jc frontWindowOnly]);
+    jc.frontWindowOnly = !jc.frontWindowOnly;
 }
 
 @end