views:

242

answers:

2

I know 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.

+1  A: 

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.

Ned Deily
A: 

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.

ngm