X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=TargetToggleMouseScope.m;h=0413b731d937a0b237d75c782dca1b6b359ddd06;hp=4f1d157aeac9a9f09afead7536b1f7a7bbb763fd;hb=e2a4d830dd9817f6a515a3b1b6aa152d3bb98c2b;hpb=0a402879ee3beb79bb4d2270f909ad75eead0c96 diff --git a/TargetToggleMouseScope.m b/TargetToggleMouseScope.m index 4f1d157..0413b73 100644 --- a/TargetToggleMouseScope.m +++ b/TargetToggleMouseScope.m @@ -3,13 +3,12 @@ // Enjoy // // Created by Yifeng Huang on 7/28/12. -// Copyright (c) 2012 __MyCompanyName__. All rights reserved. // #import "TargetToggleMouseScope.h" #import "ApplicationController.h" -#import "JoystickController.h" +#import "NJInputController.h" @implementation TargetToggleMouseScope @@ -22,17 +21,16 @@ } + (Target *)targetDeserialize:(NSDictionary *)serialization - withConfigs:(NSArray *)configs { + withMappings:(NSArray *)mappings { TargetToggleMouseScope *target = [[TargetToggleMouseScope alloc] init]; return target; } - (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; - JoystickController *jc = ac.jsController; - [jc setFrontWindowOnly: ![jc frontWindowOnly]]; - printf("Front window only: %d\n", [jc frontWindowOnly]); + ApplicationController *ac = NSApplication.sharedApplication.delegate; + NJInputController *jc = ac.inputController; + jc.frontWindowOnly = !jc.frontWindowOnly; } @end