Only refocus key input for empty/key targets.
[enjoyable.git] / TargetController.m
index 8afaaf2..14f81a9 100644 (file)
 }
 
 -(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  {