开发者

Simulate random position mouse events in Cocoa

I want to build a very rough app which will simulate mouse clicks every 10th of a second at random places on the entire screen. I was thinking of building this in Cocoa/Objective-C开发者_JS百科. Can anyone point me in a direction of research?


To do something every 1/10th of a second, you need an NSTimer.

To simulate mouse clicks, you need CGEventCreateMouseEvent() in conjunction with CGEventPost().

To generate random numbers, you need arc4random()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜