mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 17:11:52 +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:
@@ -32,3 +32,17 @@ class MouseRange:
|
||||
@classmethod
|
||||
def remap(cls, value: int, out_min: int, out_max: int) -> int:
|
||||
return tools.remap(value, cls.MIN, cls.MAX, out_min, out_max)
|
||||
|
||||
@classmethod
|
||||
def normalize(cls, value: int) -> int:
|
||||
return min(max(cls.MIN, value), cls.MAX)
|
||||
|
||||
|
||||
class MouseDelta:
|
||||
MIN = -127
|
||||
MAX = 127
|
||||
RANGE = (MIN, MAX)
|
||||
|
||||
@classmethod
|
||||
def normalize(cls, value: int) -> int:
|
||||
return min(max(cls.MIN, value), cls.MAX)
|
||||
|
||||
Reference in New Issue
Block a user