5 // Created by Yifeng Huang on 7/26/12.
6 // Copyright (c) 2012 __MyCompanyName__. All rights reserved.
9 #import "TargetMouseMove.h"
11 @implementation TargetMouseMove
13 -(void) setInputValue: (int) newIV {
14 NSPoint mouseLoc = [NSEvent mouseLocation];
20 CGEventRef move = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved, CGPointMake(mouseLoc.x, mouseLoc.y), kCGMouseButtonLeft);
21 CGEventPost(kCGHIDEventTap, move);
27 -(NSString*) stringify {
28 return [[NSString alloc] initWithFormat: @"mmove~%d", dir];
31 +(TargetMouseMove*) unstringifyImpl: (NSArray*) comps {
32 NSParameterAssert([comps count] == 2);
33 TargetMouseMove* target = [[TargetMouseMove alloc] init];
34 [target setDir: [[comps objectAtIndex:1] integerValue]];