summaryrefslogtreecommitdiff
path: root/kvmd
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-10-30 18:20:57 +0200
committerMaxim Devaev <[email protected]>2023-10-30 18:20:57 +0200
commit5241c0c579ffa6a5cdd60f7bfb128be9c6b55f94 (patch)
tree898a75bdb1debc16ff788a3427f18967ff0ef0d6 /kvmd
parent92700085718334f2b1723668f3ee205c5c3247a6 (diff)
improved jiggler
Diffstat (limited to 'kvmd')
-rw-r--r--kvmd/plugins/hid/__init__.py12
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: