mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 18:11:54 +08:00
Add support for PiKVM Switch and related features
This commit introduces several new components and improvements: - Added Switch module with firmware update and configuration support - Implemented new media streaming capabilities - Updated various UI elements and CSS styles - Enhanced keyboard and mouse event handling - Added new validators and configuration options - Updated Python version support to 3.13 - Improved error handling and logging
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user