diff --git a/pyVNC/Client.py b/pyVNC/Client.py index 42d7612..d730a05 100644 --- a/pyVNC/Client.py +++ b/pyVNC/Client.py @@ -55,7 +55,7 @@ def send_release(self, key): elif type(key) == str: self.screen.protocol.key_event(ord(key), down=0) - def send_mouse(self, event="Left", position=(0, 0)): + def send_mouse(self, event="Left", position=(0, 0), duration=0.001): # Left 1, Middle 2, Right 3, button_id = None if event is "Left": @@ -66,7 +66,11 @@ def send_mouse(self, event="Left", position=(0, 0)): button_id = 4 self.screen.protocol.pointer_event(position[0], position[1], 0) + time.sleep(duration) self.screen.protocol.pointer_event(position[0], position[1], button_id) + time.sleep(duration) + self.screen.protocol.pointer_event(position[0], position[1], 0) + def add_callback(self, interval, cb): l = task.LoopingCall(cb)