From 5241c0c579ffa6a5cdd60f7bfb128be9c6b55f94 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Mon, 30 Oct 2023 18:20:57 +0200 Subject: improved jiggler --- kvmd/plugins/hid/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/kvmd/plugins/hid/__init__.py b/kvmd/plugins/hid/__init__.py index 176ffb10..40661d74 100644 --- a/kvmd/plugins/hid/__init__.py +++ b/kvmd/plugins/hid/__init__.py @@ -110,11 +110,13 @@ class BaseHid(BasePlugin): factor = 1 while True: if self.__jiggler_active and (self.__activity_ts + 60 < int(time.monotonic())): - if self.__jiggler_absolute: - self.send_mouse_move_event(100 * factor, 100 * factor) - else: - self.send_mouse_relative_event(10 * factor, 10 * factor) - factor *= -1 + for _ in range(5): + if self.__jiggler_absolute: + self.send_mouse_move_event(100 * factor, 100 * factor) + else: + self.send_mouse_relative_event(10 * factor, 10 * factor) + factor *= -1 + await asyncio.sleep(0.1) await asyncio.sleep(1) def _bump_activity(self) -> None: -- cgit v1.2.3