5 // Created by Yifeng Huang on 7/28/12.
6 // Copyright (c) 2012 __MyCompanyName__. All rights reserved.
9 #import "TargetMouseScroll.h"
11 @implementation TargetMouseScroll
15 -(NSString*) stringify {
16 return [[NSString alloc] initWithFormat: @"mscroll~%d", howMuch];
19 +(TargetMouseScroll*) unstringifyImpl: (NSArray*) comps {
20 NSParameterAssert([comps count] == 2);
21 TargetMouseScroll* target = [[TargetMouseScroll alloc] init];
22 [target setHowMuch: [[comps objectAtIndex:1] integerValue]];
26 -(void) trigger: (JoystickController *)jc {
27 CGEventRef scroll = CGEventCreateScrollWheelEvent(NULL,
28 kCGScrollEventUnitLine,
31 CGEventPost(kCGHIDEventTap, scroll);