diff options
author | Devaev Maxim <[email protected]> | 2019-10-01 05:48:20 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-10-01 05:48:20 +0300 |
commit | 8cc5f631cafe84794c878244649ab11087631efd (patch) | |
tree | cca3e02fe967f5291b2ff791ad871e9e1fcf990e /kvmd/plugins/hid/serial.py | |
parent | 74931a8096aed89ef7d03e327978d1a2963c92c7 (diff) |
horizontal scrolling for otg
Diffstat (limited to 'kvmd/plugins/hid/serial.py')
-rw-r--r-- | kvmd/plugins/hid/serial.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kvmd/plugins/hid/serial.py b/kvmd/plugins/hid/serial.py index 40eb3268..9a5995e9 100644 --- a/kvmd/plugins/hid/serial.py +++ b/kvmd/plugins/hid/serial.py @@ -119,10 +119,11 @@ class _MouseButtonEvent(_BoolEvent): @dataclasses.dataclass(frozen=True) class _MouseWheelEvent(_IntEvent): def __post_init__(self) -> None: - assert self.x == 0 # Горизонтальная прокрутка пока не поддерживается + assert -127 <= self.x <= 127 assert -127 <= self.y <= 127 def make_command(self) -> bytes: + # Горизонтальная прокрутка пока не поддерживается return b"\x14\x00" + struct.pack(">b", self.y) + b"\x00\x00" @@ -253,8 +254,8 @@ class Plugin(BaseHid, multiprocessing.Process): # pylint: disable=too-many-inst async def send_mouse_button_event(self, button: str, state: bool) -> None: await self.__send_bool_event(_MouseButtonEvent(button, state), self.__pressed_mouse_buttons) - async def send_mouse_wheel_event(self, delta_y: int) -> None: - await self.__send_int_event(_MouseWheelEvent(0, delta_y)) + async def send_mouse_wheel_event(self, delta_x: int, delta_y: int) -> None: + await self.__send_int_event(_MouseWheelEvent(delta_x, delta_y)) async def clear_events(self) -> None: if not self.__stop_event.is_set(): |