mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
fixed pikvm/pikvm#159: workaround for windows 98 absolute mouse bug
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user