X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=Classes%2FNJDeviceController.m;h=4a6d3dc06cd19c586aef5490ede9071e3ea43527;hp=39ec389f1734633504e4a1a76fc54446507242ea;hb=91ea24909c2c38d9f3d319e6440b362222fdfd87;hpb=eb9ae7c6c0504f07fe058e9be43ec26763be4591 diff --git a/Classes/NJDeviceController.m b/Classes/NJDeviceController.m index 39ec389..4a6d3dc 100644 --- a/Classes/NJDeviceController.m +++ b/Classes/NJDeviceController.m @@ -57,7 +57,7 @@ // nothing if a noisy device is plugged in (the % of that // spent in input_callback is negligible, so it's not // something we can make faster). I don't really think that's - // acceptable, CPU/power wise. So if translation is disabled + // acceptable, CPU/power wise. So if simulation is disabled // and the window is closed, just switch off the HID manager // entirely. This probably also has some marginal benefits for // compatibility with other applications that want exclusive @@ -138,13 +138,15 @@ [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]; @@ -316,7 +318,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn if (simulatingEvents != _simulatingEvents) { _simulatingEvents = simulatingEvents; NSInteger state = simulatingEvents ? NSOnState : NSOffState; - translatingEventsButton.state = state; + simulatingEventsButton.state = state; NSString *name = simulatingEvents ? NJEventSimulationStarted : NJEventSimulationStopped;