Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #17328

Help about Xlib Library in Python

From "阮铮" <rz1991@foxmail.com>
Subject Help about Xlib Library in Python
Date 2011-12-16 12:55 +0800
Newsgroups comp.lang.python
Message-ID <mailman.3712.1324011391.27778.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi,


A question about Xlib Library in Python troubled me for several days and I finally found this email list. I hope someone could answer my question. I think it is easy for experienced user.


I would like to write a small script to response my mouse click in root screen and write something in the terminal. My script is like this, but it does not work in my computer.


from Xlib import X
import Xlib.display


def main():
    display = Xlib.display.Display()
    root = display.screen().root
    root.change_attributes(event_mask=
			X.ButtonPressMask |
			X.ButtonReleaseMask)
    while True:
        event = root.display.next_event()
        print "1"
if __name__ == "__main__":
    main()





Any hints are welcome
Thank you!


Ruan zheng

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Help about Xlib Library in Python "阮铮" <rz1991@foxmail.com> - 2011-12-16 12:55 +0800

csiph-web