#import "NJInputButton.h"
@implementation NJInputButton {
- long _max;
+ CFIndex _max;
}
-- (id)initWithName:(NSString *)name idx:(int)idx max:(long)max {
- if ((self = [super init])) {
- _max = max;
- self.name = [NSString stringWithFormat:NSLocalizedString(@"button %d", @"button name"), idx];
-
- if (name.length)
- self.name = [self.name stringByAppendingFormat:@"- %@", name];
+- (id)initWithElement:(IOHIDElementRef)element
+ index:(int)index
+ parent:(NJInputPathElement *)parent
+{
+ if ((self = [super initWithName:NJINPUT_NAME(NSLocalizedString(@"button %d", @"button name"), index)
+ eid:NJINPUT_DID("Button", index)
+ element:element
+ parent:parent])) {
+ _max = IOHIDElementGetLogicalMax(element);
}
return self;
}