#import "JSActionButton.h"
@implementation JSActionButton {
- BOOL active;
+ long _max;
}
-@synthesize max;
-@synthesize active;
-
-- (id)initWithName:(NSString *)name_ idx:(int)idx max:(int)max_ {
+- (id)initWithName:(NSString *)name idx:(int)idx max:(long)max {
if ((self = [super init])) {
- self.index = idx;
- self.max = max_;
- if (name_.length)
- self.name = [NSString stringWithFormat:@"Button %d - %@", self.index, name_];
+ _max = max;
+ if (name.length)
+ self.name = [NSString stringWithFormat:@"Button %d - %@", idx, name];
else
- self.name = [NSString stringWithFormat:@"Button %d", self.index];
+ self.name = [NSString stringWithFormat:@"Button %d", idx];
}
return self;
}
- (id)findSubActionForValue:(IOHIDValueRef)val {
- return (IOHIDValueGetIntegerValue(val) == max) ? self : nil;
+ return (IOHIDValueGetIntegerValue(val) == _max) ? self : nil;
}
- (void)notifyEvent:(IOHIDValueRef)value {
- active = IOHIDValueGetIntegerValue(value) == max;
+ self.active = IOHIDValueGetIntegerValue(value) == _max;
}
@end