summaryrefslogtreecommitdiff
path: root/kvmd/clients/kvmd.py
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2024-12-30 18:55:59 +0200
committerMaxim Devaev <[email protected]>2024-12-30 18:55:59 +0200
commitfed3bf1efdea7528919eb9f318c5ada2dcf35410 (patch)
treef1bd27d882b85cf845b92b489b1c494c4d1dd715 /kvmd/clients/kvmd.py
parentd52bb34bb9f5bc669f6b915ba585461356128e39 (diff)
pikvm/pikvm#1334: Bad link mode for keyboard events
Diffstat (limited to 'kvmd/clients/kvmd.py')
-rw-r--r--kvmd/clients/kvmd.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/kvmd/clients/kvmd.py b/kvmd/clients/kvmd.py
index a0412ce2..d9b38339 100644
--- a/kvmd/clients/kvmd.py
+++ b/kvmd/clients/kvmd.py
@@ -183,10 +183,12 @@ class KvmdClientWs:
self.__communicated = False
async def send_key_event(self, key: str, state: bool) -> None:
- await self.__writer_queue.put(bytes([1, state]) + key.encode("ascii"))
+ mask = (0b01 if state else 0)
+ await self.__writer_queue.put(bytes([1, mask]) + key.encode("ascii"))
async def send_mouse_button_event(self, button: str, state: bool) -> None:
- await self.__writer_queue.put(bytes([2, state]) + button.encode("ascii"))
+ mask = (0b01 if state else 0)
+ await self.__writer_queue.put(bytes([2, mask]) + 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))