mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-01 02:21:53 +08:00
fixed mouse remap
This commit is contained in:
@@ -32,8 +32,11 @@ from typing import Coroutine
|
||||
|
||||
from ....logging import get_logger
|
||||
|
||||
from .... import tools
|
||||
from .... import aiotools
|
||||
|
||||
from ....mouse import MouseRange
|
||||
|
||||
from .errors import RfbError
|
||||
from .errors import RfbConnectionError
|
||||
|
||||
@@ -444,8 +447,8 @@ class RfbClient(RfbClientStream): # pylint: disable=too-many-instance-attribute
|
||||
"y": (-4 if buttons & 0x10 else (4 if buttons & 0x8 else 0)),
|
||||
},
|
||||
move={
|
||||
"x": round(to_x / self._width * 65535 + -32768),
|
||||
"y": round(to_y / self._height * 65535 + -32768),
|
||||
"x": tools.remap(to_x, 0, self._width, *MouseRange.RANGE),
|
||||
"y": tools.remap(to_y, 0, self._height, *MouseRange.RANGE),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user