mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-30 17:41: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:
@@ -26,6 +26,7 @@ import struct
|
||||
from ....keyboard.mappings import KEYMAP
|
||||
|
||||
from ....mouse import MouseRange
|
||||
from ....mouse import MouseDelta
|
||||
|
||||
from .... import tools
|
||||
from .... import bitbang
|
||||
@@ -162,8 +163,8 @@ class MouseRelativeEvent(BaseEvent):
|
||||
delta_y: int
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
assert -127 <= self.delta_x <= 127
|
||||
assert -127 <= self.delta_y <= 127
|
||||
assert MouseDelta.MIN <= self.delta_x <= MouseDelta.MAX
|
||||
assert MouseDelta.MIN <= self.delta_y <= MouseDelta.MAX
|
||||
|
||||
def make_request(self) -> bytes:
|
||||
return _make_request(struct.pack(">Bbbxx", 0x15, self.delta_x, self.delta_y))
|
||||
@@ -175,8 +176,8 @@ class MouseWheelEvent(BaseEvent):
|
||||
delta_y: int
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
assert -127 <= self.delta_x <= 127
|
||||
assert -127 <= self.delta_y <= 127
|
||||
assert MouseDelta.MIN <= self.delta_x <= MouseDelta.MAX
|
||||
assert MouseDelta.MIN <= self.delta_y <= MouseDelta.MAX
|
||||
|
||||
def make_request(self) -> bytes:
|
||||
# Горизонтальная прокрутка пока не поддерживается
|
||||
|
||||
Reference in New Issue
Block a user