X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=NJInputButton.m;fp=NJInputButton.m;h=0000000000000000000000000000000000000000;hp=0c3b0ce32de0105413d0d1c4e68c86be853e62b7;hb=0064c1fbff36795885a9724081af2a17d83c20a3;hpb=56d825ba259066d847a9fc3f9c8c0c0a362a1507 diff --git a/NJInputButton.m b/NJInputButton.m deleted file mode 100644 index 0c3b0ce..0000000 --- a/NJInputButton.m +++ /dev/null @@ -1,34 +0,0 @@ -// -// NJInputButton.m -// Enjoy -// -// Created by Sam McCall on 5/05/09. -// - -#import "NJInputButton.h" - -@implementation NJInputButton { - long _max; -} - -- (id)initWithName:(NSString *)name idx:(int)idx max:(long)max { - if ((self = [super init])) { - _max = max; - if (name.length) - self.name = [NSString stringWithFormat:@"Button %d - %@", idx, name]; - else - self.name = [NSString stringWithFormat:@"Button %d", idx]; - } - return self; -} - -- (id)findSubInputForValue:(IOHIDValueRef)val { - return (IOHIDValueGetIntegerValue(val) == _max) ? self : nil; -} - -- (void)notifyEvent:(IOHIDValueRef)value { - self.active = IOHIDValueGetIntegerValue(value) == _max; - self.magnitude = IOHIDValueGetIntegerValue(value) / (float)_max; -} - -@end