5 // Created by Sam McCall on 5/05/09.
8 #import "JSActionButton.h"
10 @implementation JSActionButton {
14 - (id)initWithName:(NSString *)name idx:(int)idx max:(long)max {
15 if ((self = [super init])) {
18 self.name = [NSString stringWithFormat:@"Button %d - %@", idx, name];
20 self.name = [NSString stringWithFormat:@"Button %d", idx];
25 - (id)findSubActionForValue:(IOHIDValueRef)val {
26 return (IOHIDValueGetIntegerValue(val) == _max) ? self : nil;
29 - (void)notifyEvent:(IOHIDValueRef)value {
30 self.active = IOHIDValueGetIntegerValue(value) == _max;