From f43f909bf20dafb2c10520815282046cffe495f2 Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Sat, 22 Aug 2020 16:02:17 +0200 Subject: Refactoring, Bezier Refactored module layout. Added missing dependencies to setup. Added time scaling to curves. --- AutopyExtended/mouse.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'AutopyExtended/mouse.py') 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 -- cgit v1.2.1