Skip to content

Instantly share code, notes, and snippets.

@devpilot
Last active February 14, 2016 14:47
Show Gist options
  • Save devpilot/14059cdd44548356155e to your computer and use it in GitHub Desktop.
Save devpilot/14059cdd44548356155e to your computer and use it in GitHub Desktop.
Track mouse position on screen (win)
#!/usr/bin/env python
from ctypes import windll, Structure, c_ulong, byref
class get_maus_pp(Structure):
_fields_ = [("x", c_ulong), ("y", c_ulong)]
mpp = get_maus_pp()
while True:
windll.user32.GetCursorPos(byref(mpp))
print mpp.x, mpp.y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment