+- (void)runTargetForDevice:(IOHIDDeviceRef)device value:(IOHIDValueRef)value {
+ Joystick *js = [self findJoystickByRef:device];
+ JSAction *mainAction = [js actionForEvent:value];
+ [mainAction notifyEvent:value];
+ NSArray *children = mainAction.children ? mainAction.children : mainAction ? @[mainAction] : @[];
+ for (JSAction *subaction in children) {
+ Target *target = configsController.currentConfig[subaction];
+ target.magnitude = mainAction.magnitude;
+ target.running = subaction.active;
+ if (target.running && target.isContinuous)
+ [self addRunningTarget:target];
+ }
+}
+
+- (void)showTargetForDevice:(IOHIDDeviceRef)device value:(IOHIDValueRef)value {
+ Joystick *js = [self findJoystickByRef:device];
+ JSAction *handler = [js handlerForEvent:value];
+ if (!handler)
+ return;
+
+ [self expandRecursive:handler];
+ [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:[outlineView rowForItem:handler]] byExtendingSelection: NO];
+ [targetController focusKey];
+}
+