Mouseposition on Linux via Xlib

/ Published in: Python
Save to your folder(s)

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

Copy this code and paste it in your HTML
  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


RSS Icon Subscribe to comments

You need to login to post a comment.