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/apps | |
parent | 74931a8096aed89ef7d03e327978d1a2963c92c7 (diff) |
horizontal scrolling for otg
Diffstat (limited to 'kvmd/apps')
-rw-r--r-- | kvmd/apps/kvmd/server.py | 3 | ||||
-rw-r--r-- | kvmd/apps/otg/hid/mouse.py | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/kvmd/apps/kvmd/server.py b/kvmd/apps/kvmd/server.py index 4f197641..95926470 100644 --- a/kvmd/apps/kvmd/server.py +++ b/kvmd/apps/kvmd/server.py @@ -421,10 +421,11 @@ class Server: # pylint: disable=too-many-instance-attributes async def __handle_ws_mouse_wheel_event(self, event: Dict) -> None: try: + delta_x = valid_hid_mouse_wheel(event["delta"]["x"]) delta_y = valid_hid_mouse_wheel(event["delta"]["y"]) except Exception: return - await self.__hid.send_mouse_wheel_event(delta_y) + await self.__hid.send_mouse_wheel_event(delta_x, delta_y) # ===== HID diff --git a/kvmd/apps/otg/hid/mouse.py b/kvmd/apps/otg/hid/mouse.py index 325d27ef..bed1ffb2 100644 --- a/kvmd/apps/otg/hid/mouse.py +++ b/kvmd/apps/otg/hid/mouse.py @@ -28,7 +28,7 @@ MOUSE_HID = Hid( protocol=0, subclass=0, - report_length=6, + report_length=7, report_descriptor=bytes([ # https://github.com/NicoHood/HID/blob/0835e6a/src/SingleReport/SingleAbsoluteMouse.cpp @@ -71,6 +71,15 @@ MOUSE_HID = Hid( 0x95, 0x01, # REPORT_COUNT (1) 0x81, 0x06, # INPUT (Data,Var,Rel) + # Horizontal wheel + 0x05, 0x0C, # USAGE PAGE (Consumer Devices) + 0x0A, 0x38, 0x02, # USAGE (AC Pan) + 0x15, 0x81, # LOGICAL_MINIMUM (-127) + 0x25, 0x7F, # LOGICAL_MAXIMUM (127) + 0x75, 0x08, # REPORT_SIZE (8) + 0x95, 0x01, # REPORT_COUNT (1) + 0x81, 0x06, # INPUT (Data,Var,Rel) + # End 0xC0, # END_COLLECTION ]), |