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:
@@ -27,6 +27,7 @@ from ....keyboard.mappings import UsbKey
|
||||
from ....keyboard.mappings import KEYMAP
|
||||
|
||||
from ....mouse import MouseRange
|
||||
from ....mouse import MouseDelta
|
||||
|
||||
|
||||
# =====
|
||||
@@ -144,8 +145,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
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
@@ -154,8 +155,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_mouse_report(
|
||||
|
||||
@@ -153,7 +153,6 @@ class MouseProcess(BaseDeviceProcess):
|
||||
move_x = self.__x
|
||||
move_y = self.__y
|
||||
else:
|
||||
assert self.__x == self.__y == 0
|
||||
if relative_event is not None:
|
||||
move_x = relative_event.delta_x
|
||||
move_y = relative_event.delta_y
|
||||
@@ -177,5 +176,3 @@ class MouseProcess(BaseDeviceProcess):
|
||||
|
||||
def __clear_state(self) -> None:
|
||||
self.__pressed_buttons = 0
|
||||
self.__x = 0
|
||||
self.__y = 0
|
||||
|
||||
Reference in New Issue
Block a user