Posted By

simlan on 09/02/09


Tagged

mouse linux xlib position


Versions (?)

Mouseposition on Linux via Xlib


 / Published in: Python
 

URL: http://simlan.tumblr.com/post/2658047235/cursorposition-on-linux-printing

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
  3.  
  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.