X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=TargetMouseScroll.m;h=d840ba1069bfe2539a50cbd44d79e8d7bda40dd2;hp=4d6f409a97d2804765f74109447c2c3642837763;hb=681ca0346ecb3f3da2c45a1a470601f15aad22cf;hpb=16a7c0a04bd05f4012d5a97a53520802969cfc86 diff --git a/TargetMouseScroll.m b/TargetMouseScroll.m index 4d6f409..d840ba1 100644 --- a/TargetMouseScroll.m +++ b/TargetMouseScroll.m @@ -3,21 +3,18 @@ // Enjoy // // Created by Yifeng Huang on 7/28/12. -// Copyright (c) 2012 __MyCompanyName__. All rights reserved. // #import "TargetMouseScroll.h" @implementation TargetMouseScroll -@synthesize amount; - + (NSString *)serializationCode { return @"mscroll"; } - (NSDictionary *)serialize { - return @{ @"type": @"mscroll", @"amount": @(self.amount) }; + return @{ @"type": @"mscroll", @"amount": @(_amount) }; } + (Target *)targetDeserialize:(NSDictionary *)serialization @@ -30,7 +27,7 @@ CGEventRef scroll = CGEventCreateScrollWheelEvent(NULL, kCGScrollEventUnitLine, 1, - self.amount); + _amount); CGEventPost(kCGHIDEventTap, scroll); CFRelease(scroll); }