mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-14 02:00:32 +08:00
pikvm/pikvm#1571: hid: improved jiggler pattern
This commit is contained in:
parent
bd5e17da4b
commit
678744ce91
@ -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_active and (self.__j_activity_ts + self.__j_interval < self.__get_monotonic_seconds()):
|
||||||
if self.__j_absolute:
|
if self.__j_absolute:
|
||||||
(x, y) = (self.__j_last_x, self.__j_last_y)
|
(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))
|
self.send_mouse_move_event(MouseRange.normalize(x + move), MouseRange.normalize(y + move))
|
||||||
await asyncio.sleep(0.1)
|
await asyncio.sleep(0.1)
|
||||||
else:
|
else:
|
||||||
for move in [10, -10, 10, -10]:
|
for move in ([10, -10] * 5):
|
||||||
self.send_mouse_relative_event(move, move)
|
self.send_mouse_relative_event(move, move)
|
||||||
await asyncio.sleep(0.1)
|
await asyncio.sleep(0.1)
|
||||||
await asyncio.sleep(1)
|
await asyncio.sleep(1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user