Posted By

simlan on 09/02/09


mouse linux xlib position

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Mouseposition on Linux via Xlib

 / Published in: Python


Quick and dirty took me 2hours to find. The Xlib Documentation sucks. Have Fun\r\n\r\nnote: U need the Xlib -(Ubuntu)-> sudo apt-get install python-xlib

  1. from Xlib import X, display
  2. d = display.Display().screen().root.query_pointer()._data
  4. print "x="
  5. print d["root_x"]
  6. print "y="
  7. print d["root_y"]

Report this snippet  

You need to login to post a comment.