X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=TargetController.m;h=14f81a94dd4ab317d302cfd55ef57047f43cd498;hp=074c4876ff8717ffac5ed1f3f8b7966314f7d850;hb=08c920c47d68423c16a6deba2a59488772066f6b;hpb=25dd74a4a34f4ba7ec797360bd8f92cbd7bc758e diff --git a/TargetController.m b/TargetController.m index 074c487..14f81a9 100644 --- a/TargetController.m +++ b/TargetController.m @@ -5,6 +5,21 @@ // Created by Sam McCall on 5/05/09. // +#import "TargetController.h" + +#import "ConfigsController.h" +#import "Config.h" +#import "JSAction.h" +#import "JoystickController.h" +#import "KeyInputTextView.h" +#import "TargetConfig.h" +#import "TargetController.h" +#import "TargetKeyboard.h" +#import "TargetMouseBtn.h" +#import "TargetMouseMove.h" +#import "TargetMouseScroll.h" +#import "TargetToggleMouseScope.h" + @implementation TargetController -(void) keyChanged { @@ -40,7 +55,6 @@ if(keyInput.hasKey) { TargetKeyboard* k = [[TargetKeyboard alloc] init]; [k setVk: [keyInput vk]]; - [k setDescr: [keyInput descr]]; return k; } break; @@ -175,7 +189,11 @@ } -(void) focusKey { - [[[NSApplication sharedApplication] mainWindow] makeFirstResponder: keyInput]; + Target *currentTarget = configsController.currentConfig[currentJsaction]; + if (!currentTarget || [currentTarget isKindOfClass:[TargetKeyboard class]]) + [[[NSApplication sharedApplication] mainWindow] makeFirstResponder: keyInput]; + else + [keyInput resignFirstResponder]; } -(void) refreshConfigsPreservingSelection: (BOOL) preserve {