- [target setRunning: [subaction active]];
- [target setInputValue: IOHIDValueGetIntegerValue(value)];
+ if ([target running] != [subaction active]) {
+ if ([subaction active]) {
+ [target trigger: self];
+ }
+ else {
+ [target untrigger: self];
+ }
+ [target setRunning: [subaction active]];
+ }
+
+ if ([mainAction isKindOfClass: [JSActionAnalog class]]) {
+ double realValue = [(JSActionAnalog*)mainAction getRealValue: IOHIDValueGetIntegerValue(value)];
+ [target setInputValue: realValue];
+
+ // Add to list of running targets
+ if ([target isContinuous] && [target running]) {
+ if (!objInArray([self runningTargets], target)) {
+ [[self runningTargets] addObject: target];
+ }
+ }
+ }