diff options
author | Maxim Devaev <[email protected]> | 2023-10-30 18:20:57 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-10-30 18:20:57 +0200 |
commit | 5241c0c579ffa6a5cdd60f7bfb128be9c6b55f94 (patch) | |
tree | 898a75bdb1debc16ff788a3427f18967ff0ef0d6 /kvmd/plugins | |
parent | 92700085718334f2b1723668f3ee205c5c3247a6 (diff) |
improved jiggler
Diffstat (limited to 'kvmd/plugins')
-rw-r--r-- | kvmd/plugins/hid/__init__.py | 12 |
1 files 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: |