By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,100 Members | 2,846 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,100 IT Pros & Developers. It's quick & easy.

X/Linux mouse_event (like in win32api)

P: n/a
Hello everyone.
I would like to be able to emit a mouse click on my xgl/compiz
desktop, like I used to do in Windows:

win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN , x, y, 0)
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, x, y, 0)

I installed Python and pywin32 in wine and they both work, but I
cannot extend the mouse emulation to my X desktop.
Is there a way to interact directly with the X server (or with the
kernel?) to simulate a click? And if it can't be done in Python, where
should I go?

Thank you in advance for your replies.
Nov 29 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Thu, 29 Nov 2007 01:59:20 -0800 (PST), Atila Olah <jo*****@gmail.comwrote:
Hello everyone.
I would like to be able to emit a mouse click on my xgl/compiz
desktop, like I used to do in Windows:
....
Is there a way to interact directly with the X server (or with the
kernel?) to simulate a click? And if it can't be done in Python, where
should I go?
This is probably best done in Xlib, the lowest-level X11 API. See the
XSendEvent() call, and feed it to Google for more information.

I think there is a Python interface to Xlib, although I haven't used it.

/Jorgen

--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.dyndns.org R'lyeh wgah'nagl fhtagn!
Dec 2 '07 #2

P: n/a
Thank you Jorgen. Your answer helped me a lot.
Jan 14 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.