Don't let the app control itself, it only leads to accidents or mouse bugs. Don't...
[enjoyable.git] / Classes / NJDeviceController.m
index 39ec389..0b0fe92 100644 (file)
     [self expandRecursive:handler];
     [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:[outlineView rowForItem:handler]]
              byExtendingSelection: NO];
-    [outputController focusKey];
+    if (!self.simulatingEvents)
+        [outputController focusKey];
 }
 
 - (void)hidManager:(NJHIDManager *)manager
       valueChanged:(IOHIDValueRef)value
         fromDevice:(IOHIDDeviceRef)device {
-    if (self.simulatingEvents) {
+    if (self.simulatingEvents
+        && !NSApplication.sharedApplication.isActive) {
         [self runOutputForDevice:device value:value];
     } else {
         [self showOutputForDevice:device value:value];