Basic point and clicking.

This commit is contained in:
Cory Walker 2011-06-30 16:34:49 -04:00
parent 78644fd866
commit 1eb75708a9
3 changed files with 25 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.pyc

View File

@ -0,0 +1,8 @@
from py_xdotool import *
from time import sleep
mousemove(0, 0)
sleep(1)
click_at(100, 100, 3)
sleep(1)
click_at(500, 100, 1)

View File

@ -0,0 +1,16 @@
from subprocess import Popen, PIPE
def mousemove(x, y):
c = "mousemove %d %d" % (x, y)
return run_command(c)
def click(btn):
c = "click %d" % btn
return run_command(c)
def click_at(x, y, btn):
mousemove(x, y)
return click(btn)
def run_command(c):
return Popen("xdotool " + c, stdout=PIPE, shell=True).stdout.read()