5 // Created by Sam McCall on 5/05/09.
8 #import "JSActionButton.h"
10 @implementation JSActionButton {
17 - (id)initWithName:(NSString *)name_ idx:(int)idx max:(int)max_ {
18 if ((self = [super init])) {
22 self.name = [NSString stringWithFormat:@"Button %d - %@", self.index, name_];
24 self.name = [NSString stringWithFormat:@"Button %d", self.index];
29 - (id)findSubActionForValue:(IOHIDValueRef)val {
30 return (IOHIDValueGetIntegerValue(val) == max) ? self : nil;
33 - (void)notifyEvent:(IOHIDValueRef)value {
34 active = IOHIDValueGetIntegerValue(value) == max;