开发者

How to program a mouse click on Mac OS X and on Linux?

开发者 https://www.devze.com 2022-12-12 07:25 出处:网络
I kno开发者_如何学编程w how to program a click on Win32 (click on the screen programmatically) using C or Ruby.Does anyone know how to do it on Mac OS X and Linux just as a comparison?thanks.For OS X,

I kno开发者_如何学编程w how to program a click on Win32 (click on the screen programmatically) using C or Ruby. Does anyone know how to do it on Mac OS X and Linux just as a comparison? thanks.


For OS X, there are various approaches (i.e. Carbon, Cocoa, Apple Events) to programming a mouse click described in the article and comments here.


I asked this question myself recently on identi.ca, and got the following answers:

"You can try XSendEvent in Xlib or xcb_send_event in XCB."

"Try a small utility called xte (part of the xautomation package.)"

I also found a tool called xdotool which allows you to programatically simulate keyboard and mouse activity, amongst other things.

0

精彩评论

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