summaryrefslogtreecommitdiff
path: root/kvmd/apps/vnc/rfb/__init__.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2021-03-26 21:32:21 +0300
committerDevaev Maxim <[email protected]>2021-03-26 21:32:21 +0300
commita66221a494e35ab070d13291ce82928797bf95d4 (patch)
tree3dd496eccf1f3281dad1d545e50a111c28ccdfbc /kvmd/apps/vnc/rfb/__init__.py
parent1674cf70b3f925fe055398911761542c14d304e9 (diff)
fixed mouse remap
Diffstat (limited to 'kvmd/apps/vnc/rfb/__init__.py')
-rw-r--r--kvmd/apps/vnc/rfb/__init__.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/kvmd/apps/vnc/rfb/__init__.py b/kvmd/apps/vnc/rfb/__init__.py
index 48805f27..8eff691a 100644
--- a/kvmd/apps/vnc/rfb/__init__.py
+++ b/kvmd/apps/vnc/rfb/__init__.py
@@ -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),
},
)