aboutsummaryrefslogtreecommitdiff
path: root/AutopyExtended/mouse.py
diff options
context:
space:
mode:
authorLeonard Kugis <leonard@kug.is>2020-08-22 16:02:17 +0200
committerLeonard Kugis <leonard@kug.is>2020-08-22 16:02:17 +0200
commitf43f909bf20dafb2c10520815282046cffe495f2 (patch)
tree5be52b3a048c0b2755a670de4269460353bc9760 /AutopyExtended/mouse.py
parent3b47fad88c8b714c83c1c90cf6726d85688b300f (diff)
Refactoring, Bezier
Refactored module layout. Added missing dependencies to setup. Added time scaling to curves.
Diffstat (limited to 'AutopyExtended/mouse.py')
-rw-r--r--AutopyExtended/mouse.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/AutopyExtended/mouse.py b/AutopyExtended/mouse.py
index 0b06c11..f79255f 100644
--- a/AutopyExtended/mouse.py
+++ b/AutopyExtended/mouse.py
@@ -1,4 +1,10 @@
import autopy
+import time
-def move(target, time, curve, time_scale=(lambda x : 1 * x)):
-
+def move(curve, time_target, time_scale=(lambda x : 1 * x)):
+ start = time.time()
+ delta = 0
+ while(delta < time_target):
+ point = curve.point(time_scale(delta), time_target)
+ autopy.mouse.move(point[0], point[1])
+ delta = time.time() - start