Skip to content

Commit b6d406d

Browse files
Bret Barkelewapop5
Bret Barkelew
authored andcommitted
MdeModulePkg: Correct Usb Mouse Z for absolute pointer.
https://www.usb.org/sites/default/files/hid1_11.pdf Appendix B, B.2 Protocol 2 (Mouse) details the information returned by a usb mouse HID. bytes 3..n are specific to the device, but are used by absolute pointer devices to return a z axis. Prior to this change, the existing code was reusing the X value for the Z axis, which was incorrect. For usb devices which do not return enough data for a z axis, this change will be a no-op. Signed-off-by: Aaron Pop <[email protected]>
1 parent dd8c272 commit b6d406d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointer.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ OnMouseInterruptComplete (
847847
UsbMouseAbsolutePointerDevice->State.CurrentZ =
848848
MIN (
849849
MAX (
850-
(INT64)UsbMouseAbsolutePointerDevice->State.CurrentZ + *((INT8 *)Data + 1),
850+
(INT64)UsbMouseAbsolutePointerDevice->State.CurrentZ + *((INT8 *)Data + 3),
851851
(INT64)UsbMouseAbsolutePointerDevice->Mode.AbsoluteMinZ
852852
),
853853
(INT64)UsbMouseAbsolutePointerDevice->Mode.AbsoluteMaxZ

0 commit comments

Comments
 (0)