summaryrefslogtreecommitdiff
path: root/kvmd/validators
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2021-03-26 21:32:21 +0300
committerDevaev Maxim <[email protected]>2021-03-26 21:32:21 +0300
commita66221a494e35ab070d13291ce82928797bf95d4 (patch)
tree3dd496eccf1f3281dad1d545e50a111c28ccdfbc /kvmd/validators
parent1674cf70b3f925fe055398911761542c14d304e9 (diff)
fixed mouse remap
Diffstat (limited to 'kvmd/validators')
-rw-r--r--kvmd/validators/hid.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/kvmd/validators/hid.py b/kvmd/validators/hid.py
index bb7e26e1..f47a516c 100644
--- a/kvmd/validators/hid.py
+++ b/kvmd/validators/hid.py
@@ -24,6 +24,8 @@ from typing import Any
from ..keyboard.mappings import KEYMAP
+from ..mouse import MouseRange
+
from . import check_string_in_list
from .basic import valid_number
@@ -42,9 +44,9 @@ def valid_hid_key(arg: Any) -> str:
return check_string_in_list(arg, "Keyboard key", KEYMAP, lower=False)
-def valid_hid_mouse_move(arg: Any, move_min: int=-32768, move_max: int=32767) -> int:
+def valid_hid_mouse_move(arg: Any) -> int:
arg = valid_number(arg, name="Mouse move")
- return min(max(move_min, arg), move_max)
+ return min(max(MouseRange.MIN, arg), MouseRange.MAX)
def valid_hid_mouse_button(arg: Any) -> str: