summaryrefslogtreecommitdiff
path: root/kvmd/clients
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2023-06-07 05:12:22 +0300
committerMaxim Devaev <[email protected]>2023-06-07 05:12:22 +0300
commit9f98a2f701703a3f9f591868547c834463d3d6b1 (patch)
treef2fe4f4541c78edaa6ec791a304d73f0595d4751 /kvmd/clients
parent9c694da00c7d93cbff3aa910ffdeeb8dded691c0 (diff)
binary keyboard protocol
Diffstat (limited to 'kvmd/clients')
-rw-r--r--kvmd/clients/kvmd.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/kvmd/clients/kvmd.py b/kvmd/clients/kvmd.py
index ec86378d..569fb9d0 100644
--- a/kvmd/clients/kvmd.py
+++ b/kvmd/clients/kvmd.py
@@ -188,10 +188,10 @@ class KvmdClientWs:
self.__communicated = False
async def send_key_event(self, key: str, state: bool) -> None:
- await self.__writer_queue.put(("key", {"key": key, "state": state}))
+ await self.__writer_queue.put(bytes([1, state]) + key.encode("ascii"))
async def send_mouse_button_event(self, button: str, state: bool) -> None:
- await self.__writer_queue.put(("mouse_button", {"button": button, "state": state}))
+ await self.__writer_queue.put(bytes([2, state]) + button.encode("ascii"))
async def send_mouse_move_event(self, to_x: int, to_y: int) -> None:
await self.__writer_queue.put(struct.pack(">bhh", 3, to_x, to_y))