From 678744ce917175e10cf0f2e5ad435c06a556cae9 Mon Sep 17 00:00:00 2001 From: Maxim Devaev Date: Tue, 12 Aug 2025 22:07:05 +0300 Subject: [PATCH] pikvm/pikvm#1571: hid: improved jiggler pattern --- kvmd/plugins/hid/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kvmd/plugins/hid/__init__.py b/kvmd/plugins/hid/__init__.py index 397bb90c..c376cbc0 100644 --- a/kvmd/plugins/hid/__init__.py +++ b/kvmd/plugins/hid/__init__.py @@ -282,11 +282,11 @@ class BaseHid(BasePlugin): # pylint: disable=too-many-instance-attributes if self.__j_active and (self.__j_activity_ts + self.__j_interval < self.__get_monotonic_seconds()): if self.__j_absolute: (x, y) = (self.__j_last_x, self.__j_last_y) - for move in [100, -100, 100, -100, 0]: + for move in (([100, -100] * 5) + [0]): self.send_mouse_move_event(MouseRange.normalize(x + move), MouseRange.normalize(y + move)) await asyncio.sleep(0.1) else: - for move in [10, -10, 10, -10]: + for move in ([10, -10] * 5): self.send_mouse_relative_event(move, move) await asyncio.sleep(0.1) await asyncio.sleep(1)