Skip to content

Instantly share code, notes, and snippets.

@kra3
Created October 12, 2011 11:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kra3/1280975 to your computer and use it in GitHub Desktop.
Save kra3/1280975 to your computer and use it in GitHub Desktop.
To keep your mouse busy, so you will be always online in IM even if you are not at desk.
__author__ = "Arun K Rajeevan (kra3)"
__copyright__ = "Copyright 2011-2012"
__license__ = "BSD"
__version__ = "2"
__email__ = "the1.arun@gmail.com"
__status__ = "Production"
import time
import ctypes
class POINT(ctypes.Structure):
_fields_ = [('x', ctypes.c_ulong), ('y', ctypes.c_ulong)]
u32 = ctypes.windll.user32
global pt
pt = POINT()
if __name__ == "__main__":
while True:
for i in range(27):
u32.GetCursorPos(ctypes.byref(pt))
x = int(pt.x+1)
y = int(pt.y+1)
u32.SetCursorPos(x,y)
time.sleep(3.33)
u32.mouse_event(4, x, y, 0,0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment