Better constructor for Config.
[enjoyable.git] / TargetMouseScroll.m
index 3c417c1..4d6f409 100644 (file)
 
 @implementation TargetMouseScroll
 
-@synthesize howMuch;
+@synthesize amount;
 
 + (NSString *)serializationCode {
     return @"mscroll";
 }
 
 - (NSDictionary *)serialize {
-    return @{ @"type": @"mscroll", @"howMuch": @(self.howMuch) };
+    return @{ @"type": @"mscroll", @"amount": @(self.amount) };
 }
 
 + (Target *)targetDeserialize:(NSDictionary *)serialization
                   withConfigs:(NSArray *)configs {
        TargetMouseScroll *target = [[TargetMouseScroll alloc] init];
-    target.howMuch = [serialization[@"howMuch"] intValue];
+    target.amount = [serialization[@"amount"] intValue];
        return target;
 }
 -(void) trigger {
     CGEventRef scroll = CGEventCreateScrollWheelEvent(NULL,
                                                       kCGScrollEventUnitLine,
                                                       1,
-                                                      self.howMuch);
+                                                      self.amount);
     CGEventPost(kCGHIDEventTap, scroll);
     CFRelease(scroll);
 }