summaryrefslogtreecommitdiff
path: root/kvmd/mouse.py
diff options
context:
space:
mode:
Diffstat (limited to 'kvmd/mouse.py')
-rw-r--r--kvmd/mouse.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/kvmd/mouse.py b/kvmd/mouse.py
index 31894297..3fb76800 100644
--- a/kvmd/mouse.py
+++ b/kvmd/mouse.py
@@ -32,3 +32,7 @@ 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)