From 05b437f60fe876a8e30479b4e53ac822570480b9 Mon Sep 17 00:00:00 2001 From: CleverMouse Date: Mon, 1 Jul 2013 15:57:13 +0000 Subject: [PATCH] USB HID mouse: horizontal scrolling git-svn-id: svn://kolibrios.org@3741 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/drivers/usbhid/mouse.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/kernel/trunk/drivers/usbhid/mouse.inc b/kernel/trunk/drivers/usbhid/mouse.inc index 9f0ee65010..78d9e82bb7 100644 --- a/kernel/trunk/drivers/usbhid/mouse.inc +++ b/kernel/trunk/drivers/usbhid/mouse.inc @@ -25,6 +25,7 @@ buttons dd ? ; buttons that are currently pressed dx dd ? ; current x moving dy dd ? ; current y moving wheel dd ? ; current wheel moving +hwheel dd ? ends ; This procedure is called when HID layer detects a new mouse. @@ -56,6 +57,7 @@ proc mouse_driver_begin_packet mov [edi+mouse_device_data.dx], 0 mov [edi+mouse_device_data.dy], 0 mov [edi+mouse_device_data.wheel], 0 + mov [edi+mouse_device_data.hwheel], 0 ret endp @@ -83,6 +85,8 @@ proc mouse_driver_input_field jz .y cmp ecx, USAGE_GD_WHEEL jz .wheel + cmp ecx, 0xC0238 + jz .hwheel sub ecx, USAGE_BUTTON_PAGE + 1 jb .unclaimed cmp ecx, 32 @@ -129,6 +133,11 @@ end if neg edx mov [edi+mouse_device_data.wheel], edx ret +.hwheel: + test byte [esi+report_field_group.flags], HID_FIELD_RELATIVE + jz .unclaimed + mov [edi+mouse_device_data.hwheel], edx + ret endp ; This procedure is called when HID layer ends processing a new input packet @@ -141,6 +150,6 @@ proc mouse_driver_end_packet [edi+mouse_device_data.dx], \ [edi+mouse_device_data.dy], \ [edi+mouse_device_data.wheel], \ - 0 + [edi+mouse_device_data.hwheel] ret endp