2 // TargetToggleMouseScope.m
5 // Created by Yifeng Huang on 7/28/12.
8 #import "TargetToggleMouseScope.h"
10 #import "ApplicationController.h"
11 #import "JoystickController.h"
13 @implementation TargetToggleMouseScope
15 + (NSString *)serializationCode {
19 - (NSDictionary *)serialize {
20 return @{ @"type": @"mtoggle" };
23 + (Target *)targetDeserialize:(NSDictionary *)serialization
24 withConfigs:(NSArray *)configs {
25 TargetToggleMouseScope *target = [[TargetToggleMouseScope alloc] init];
29 // FIXME: It's hacky to get at the controller this way, but it's
30 // also hacky to pass it. Shouldn't need to do either.
31 ApplicationController *ac = [NSApplication sharedApplication].delegate;
32 JoystickController *jc = ac.jsController;
33 [jc setFrontWindowOnly: ![jc frontWindowOnly]];
34 printf("Front window only: %d\n", [jc frontWindowOnly]);