From a3e54537d8299fed3eadbdf54b2c0b1f666d8500 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Fri, 20 Mar 2020 03:17:59 +0300 Subject: oops --- kvmd/apps/vnc/server.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'kvmd/apps/vnc/server.py') diff --git a/kvmd/apps/vnc/server.py b/kvmd/apps/vnc/server.py index 8ce78d41..d9225f3b 100644 --- a/kvmd/apps/vnc/server.py +++ b/kvmd/apps/vnc/server.py @@ -209,7 +209,11 @@ class _Client(RfbClient): # pylint: disable=too-many-instance-attributes return False async def _on_key_event(self, code: int, state: bool) -> None: - print("KeyEvent", code, state, self.__symmap.get(code)) # TODO + if (web_name := self.__symmap.get(code)) is not None: # noqa: E203,E231 + await self.__ws_writer_queue.put({ + "event_type": "key", + "event": {"key": web_name, "state": state}, + }) async def _on_pointer_event(self, buttons: Dict[str, bool], wheel: Dict[str, int], move: Dict[str, int]) -> None: for (button, state) in buttons.items(): @@ -234,7 +238,7 @@ class _Client(RfbClient): # pylint: disable=too-many-instance-attributes self.__mouse_move = move async def _on_cut_event(self, text: str) -> None: - print("CutEvent", text) # TODO + pass # print("CutEvent", text) # TODO async def _on_set_encodings(self) -> None: assert self.__authorized.done() -- cgit v1.2.3