471,325 Members | 1,414 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

X/Linux mouse_event (like in win32api)

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
2 3506
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
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.

Similar topics

5 posts views Thread by Gary Richardson | last post: by
4 posts views Thread by bowchow79 | last post: by
reply views Thread by Mike | last post: by
13 posts views Thread by Abhishek | last post: by
1 post views Thread by reginpc | last post: by
1 post views Thread by tkpmep | last post: by
3 posts views Thread by Levi Campbell | last post: by
1 post views Thread by Michiel Overtoom | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.