-- (id)initWithIndex:(int)index rawMin:(long)rawMin_ rawMax:(long)rawMax_ {
- if ((self = [super init])) {
- self.name = [[NSString alloc] initWithFormat: @"Axis %d", index];
- self.children = @[[[NJInput alloc] initWithName:@"Low" base:self],
- [[NJInput alloc] initWithName:@"High" base:self]];
- rawMax = rawMax_;
- rawMin = rawMin_;
+- (id)initWithElement:(IOHIDElementRef)element
+ index:(int)index
+ parent:(NJInputPathElement *)parent
+{
+ if ((self = [super initWithName:NJINPUT_NAME(NSLocalizedString(@"axis %d", @"axis name"), index)
+ eid:NJINPUT_EID("Axis", index)
+ element:element
+ parent:parent])) {
+ self.children = @[[[NJInput alloc] initWithName:NSLocalizedString(@"axis low", @"axis low trigger")
+ eid:@"Low"
+ parent:self],
+ [[NJInput alloc] initWithName:NSLocalizedString(@"axis high", @"axis high trigger")
+ eid:@"High"
+ parent:self]];
+ _rawMax = IOHIDElementGetPhysicalMax(element);
+ _rawMin = IOHIDElementGetPhysicalMin(element);