mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 10:01:53 +08:00
horizontal scrolling for otg
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
]),
|
||||
|
||||
Reference in New Issue
Block a user