Basic point and clicking.
This commit is contained in:
parent
78644fd866
commit
1eb75708a9
|
@ -0,0 +1 @@
|
||||||
|
*.pyc
|
|
@ -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)
|
|
@ -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()
|
Loading…
Reference in New Issue