diff options
author | Devaev Maxim <[email protected]> | 2021-03-26 21:32:21 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2021-03-26 21:32:21 +0300 |
commit | a66221a494e35ab070d13291ce82928797bf95d4 (patch) | |
tree | 3dd496eccf1f3281dad1d545e50a111c28ccdfbc /kvmd/validators | |
parent | 1674cf70b3f925fe055398911761542c14d304e9 (diff) |
fixed mouse remap
Diffstat (limited to 'kvmd/validators')
-rw-r--r-- | kvmd/validators/hid.py | 6 |
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: |