Mouse Events

Hello. I've been looking on Google for a while and haven't found much. Can anyone point me to a reference on how to use C/C++ to move and click the mouse. Eventually I'll also want it "press" keys on the keyboard as well, so if that's included, that would be great.
Last edited on
you need to use some api's to do that...

on windows win32/mfc, the evens which you can catch is wm_mousemove, wm_lbuttondown etc etc..

on linux you can use qt/wxwidgets to do the same.
May I remind the two responders that this is a UNIX/Linux forum. Win32 stuff doesn't apply.

There is no simple answer, and the answer will depend more directly on what exactly you are trying to do.

The most basic way would be to generate X events that correspond to mouse and keyboard stuff. You would have to know what window to send the events to, though.

Some reading:
The Xlib Manual
http://tronche.com/gui/x/xlib/

Basic Graphics Programming With The Xlib Library
http://users.actcom.co.il/~choo/lupg/tutorials/xlib-programming/xlib-programming.html

Hope this helps.
Topic archived. No new replies allowed.