X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=TargetToggleMouseScope.m;h=0413b731d937a0b237d75c782dca1b6b359ddd06;hp=968237cfa1bf2d1ef7c1ab1a5c221dccc783c42d;hb=e2a4d830dd9817f6a515a3b1b6aa152d3bb98c2b;hpb=51336622a1df8de5dd8aaec0972b9b04292fd88d diff --git a/TargetToggleMouseScope.m b/TargetToggleMouseScope.m index 968237c..0413b73 100644 --- a/TargetToggleMouseScope.m +++ b/TargetToggleMouseScope.m @@ -8,7 +8,7 @@ #import "TargetToggleMouseScope.h" #import "ApplicationController.h" -#import "JoystickController.h" +#import "NJInputController.h" @implementation TargetToggleMouseScope @@ -21,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