summaryrefslogtreecommitdiff
path: root/kvmd/apps/vnc
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-05-22 21:07:54 +0300
committerDevaev Maxim <[email protected]>2020-05-22 21:07:54 +0300
commit43afd9acb3a7f2c94a3515f580ec3afcee720dc2 (patch)
treee1e3031ea1f083f17751c4997f29708dfb7e5d98 /kvmd/apps/vnc
parent0fa0680bd7c28e246c70b5a5102e38a592bd0f0d (diff)
server-side paste-as-keys
Diffstat (limited to 'kvmd/apps/vnc')
-rw-r--r--kvmd/apps/vnc/server.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/kvmd/apps/vnc/server.py b/kvmd/apps/vnc/server.py
index e2ac697c..0b9a26f6 100644
--- a/kvmd/apps/vnc/server.py
+++ b/kvmd/apps/vnc/server.py
@@ -278,7 +278,14 @@ class _Client(RfbClient): # pylint: disable=too-many-instance-attributes
self.__mouse_move = move
async def _on_cut_event(self, text: str) -> None:
- pass # print("CutEvent", text) # TODO
+ assert self.__authorized.done()
+ (user, passwd) = self.__authorized.result()
+ logger = get_logger(0)
+ logger.info("[main] Client %s: Printing %d characters ...", self._remote, len(text))
+ try:
+ await self.__kvmd.hid.print(user, passwd, text, 0)
+ except Exception:
+ logger.exception("[main] Client %s: Can't print characters", self._remote)
async def _on_set_encodings(self) -> None:
assert self.__authorized.done()