From 28cc3fe99a3e90213f1f01286b5ec55f4f06224c Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Tue, 18 Aug 2020 10:45:15 +0300 Subject: mouse buttons 4 and 5 --- kvmd/apps/vnc/rfb/__init__.py | 2 ++ kvmd/apps/vnc/server.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'kvmd/apps/vnc') diff --git a/kvmd/apps/vnc/rfb/__init__.py b/kvmd/apps/vnc/rfb/__init__.py index f10d7da2..27aa41ad 100644 --- a/kvmd/apps/vnc/rfb/__init__.py +++ b/kvmd/apps/vnc/rfb/__init__.py @@ -400,6 +400,8 @@ class RfbClient(RfbClientStream): # pylint: disable=too-many-instance-attribute "left": bool(buttons & 0x1), "right": bool(buttons & 0x4), "middle": bool(buttons & 0x2), + "up": bool(buttons & 0x8), # Back + "down": bool(buttons & 0x10), # Forward }, wheel={ "x": (-4 if buttons & 0x40 else (4 if buttons & 0x20 else 0)), diff --git a/kvmd/apps/vnc/server.py b/kvmd/apps/vnc/server.py index 2ab03f36..cb769481 100644 --- a/kvmd/apps/vnc/server.py +++ b/kvmd/apps/vnc/server.py @@ -114,7 +114,7 @@ class _Client(RfbClient): # pylint: disable=too-many-instance-attributes # Эти состояния шарить не обязательно - бекенд исключает дублирующиеся события. # Все это нужно только чтобы не посылать лишние жсоны в сокет KVMD - self.__mouse_buttons: Dict[str, Optional[bool]] = {"left": None, "right": None, "middle": None} + self.__mouse_buttons: Dict[str, Optional[bool]] = dict.fromkeys(["left", "right", "middle", "up", "down"], None) self.__mouse_move = {"x": -1, "y": -1} self.__lock = asyncio.Lock() -- cgit v1.2.3