X-Git-Url: https://git.yukkurigames.com/?a=blobdiff_plain;f=TargetMouseScroll.m;h=d840ba1069bfe2539a50cbd44d79e8d7bda40dd2;hb=32ca88087708a8b1f7e65ecbea6c5fd6690431d3;hp=4d6f409a97d2804765f74109447c2c3642837763;hpb=16a7c0a04bd05f4012d5a97a53520802969cfc86;p=enjoyable.git 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); }