开发者

Simulate random position mouse events in Cocoa

开发者 https://www.devze.com 2023-01-08 09:30 出处:网络
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 any

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

精彩评论

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