summaryrefslogtreecommitdiff
path: root/kvmd/apps/vnc/server.py
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-03-20 03:17:59 +0300
committerDevaev Maxim <[email protected]>2020-03-20 03:17:59 +0300
commita3e54537d8299fed3eadbdf54b2c0b1f666d8500 (patch)
treea8b5ee6323c4df65d833ee7dc063606b4ef5a029 /kvmd/apps/vnc/server.py
parentf69e6ae089d0d457a3240d6171143ebf3bba1fad (diff)
oops
Diffstat (limited to 'kvmd/apps/vnc/server.py')
-rw-r--r--kvmd/apps/vnc/server.py8
1 files changed, 6 insertions, 2 deletions
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()