summaryrefslogtreecommitdiff
path: root/kvmd/mouse.py
diff options
context:
space:
mode:
authorMaxim Devaev <[email protected]>2025-01-10 23:04:12 +0200
committerMaxim Devaev <[email protected]>2025-01-10 23:04:12 +0200
commite7c06643b4a43c1d35bd2c3aaf4326547084b091 (patch)
tree7abb1ac834d3fa1685bf14af31a596397911b0c5 /kvmd/mouse.py
parent72c9ae3aa00b8817fab2b8243203ca6e1c25e146 (diff)
refactoring
Diffstat (limited to 'kvmd/mouse.py')
-rw-r--r--kvmd/mouse.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/kvmd/mouse.py b/kvmd/mouse.py
index 3fb76800..399c6a33 100644
--- a/kvmd/mouse.py
+++ b/kvmd/mouse.py
@@ -36,3 +36,13 @@ class MouseRange:
@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)