diff options
author | Maxim Devaev <[email protected]> | 2021-08-14 09:21:04 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2021-08-14 09:29:12 +0300 |
commit | ed5952f13ef1baede4101934bc5df952ce66af1b (patch) | |
tree | 62d89ad0203fafdb018dc31ba97a3ae96c8aafca /kvmd/plugins/hid/otg/mouse.py | |
parent | c4b9eba250b15afb09720d4a9e2818a9bf447efe (diff) |
fixed pikvm/pikvm#159: workaround for windows 98 absolute mouse bug
Diffstat (limited to 'kvmd/plugins/hid/otg/mouse.py')
-rw-r--r-- | kvmd/plugins/hid/otg/mouse.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kvmd/plugins/hid/otg/mouse.py b/kvmd/plugins/hid/otg/mouse.py index 620effc5..4ede3277 100644 --- a/kvmd/plugins/hid/otg/mouse.py +++ b/kvmd/plugins/hid/otg/mouse.py @@ -42,6 +42,7 @@ from .events import make_mouse_report class MouseProcess(BaseDeviceProcess): def __init__(self, **kwargs: Any) -> None: self.__absolute: bool = kwargs.pop("absolute") + self.__absolute_win98_fix: bool = kwargs.pop("absolute_win98_fix") self.__horizontal_wheel: bool = kwargs.pop("horizontal_wheel") super().__init__( @@ -143,6 +144,12 @@ class MouseProcess(BaseDeviceProcess): assert relative_event is None move_x = self.__x move_y = self.__y + if self.__absolute_win98_fix: + # https://github.com/pikvm/pikvm/issues/159 + # For some reason, the correct implementation of this fix + # is a shift to the left, and not to the right, as in VirtualBox + move_x <<= 1 + move_y <<= 1 else: assert self.__x == self.__y == 0 if relative_event is not None: |