dogtail [PATCH] Make delay configurable in absoluteMotion and relativeMotion functions



Fixes bug# 804672
---
 dogtail/rawinput.py |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/dogtail/rawinput.py b/dogtail/rawinput.py
index 0fc6a96..faaa135 100644
--- a/dogtail/rawinput.py
+++ b/dogtail/rawinput.py
@@ -55,18 +55,24 @@ def release (x, y, button = 1): 
     registry.generateMouseEvent(x,y, 'b%sr' % button)
     doDelay()
 
-def absoluteMotion (x, y): 
+def absoluteMotion (x, y, mouseDelay=None):
     """ 
     Synthesize mouse absolute motion to (x,y)
     """ 
     logger.log("Mouse absolute motion to (%s,%s)"%(x,y))
     registry.generateMouseEvent(x,y, 'abs')
-    doDelay()
+    if mouseDelay:
+        doDelay(mouseDelay)
+    else:
+        doDelay()
 
-def relativeMotion (x, y): 
+def relativeMotion (x, y, mouseDelay=None):
     logger.log("Mouse relative motion of (%s,%s)"%(x,y))
     registry.generateMouseEvent(x,y, 'rel')
-    doDelay()
+    if mouseDelay:
+        doDelay(mouseDelay)
+    else:
+        doDelay()
 
 def drag(fromXY, toXY, button = 1): 
     """ 
-- 
1.7.6.4






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]