4
저는 Snow Leopard에서 Mac OS X 응용 프로그램을 쓰고 있습니다. 나는 NSTimer에 의해 규칙적인 간격으로 해고되는 step method를 가지고있다. 이 메서드에서는 단추를 누르거나 놓지 않고 마우스를 화면 가운데로 옮기려고합니다. 여기에 내가 가지고있는 것 :코코아 마우스 이동
-(void) step: (NSTimer *) timer
{
NSRect bounds = [self bounds];
CGPoint point = CGPointMake(bounds.origin.x + bounds.size.width/2.0f, bounds.origin.y + bounds.size.height/2.0f);
CGEventCreateMouseEvent(NULL, kCGEventLeftMouseDragged, point, 0);
}
이것은 아무 것도하지 않습니다. 누가 잘못되었는지 말해 줄 수 있니?
완벽하게 작업했습니다. 감사. – LandonSchropp