Skip to content

MdeModulePkg: Correct Usb Mouse Z for absolute pointer. #11030

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

apop5
Copy link
Contributor

@apop5 apop5 commented May 2, 2025

Description

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.

for reference, the dxemouse can also be viewed to show that for "z axis" is it referencing the 3rd byte of returned data.

  • Breaking change?
  • Impacts security?
  • Includes tests?

How This Was Tested

N/A

Integration Instructions

No integration necessary.

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]>
@apop5 apop5 force-pushed the personal/apop5/absolutepointer branch from cac39f9 to b6d406d Compare May 2, 2025 22:28
@mdkinney
Copy link
Member

mdkinney commented May 5, 2025

How was this tested?

@apop5
Copy link
Contributor Author

apop5 commented May 7, 2025

How was this tested?

The details of the testing of this have been lost, but its been used since 2018 in platforms with absolute pointers (usb touch screens) since then.

@mdkinney
Copy link
Member

mdkinney commented May 7, 2025

@lgao4 This PR was submitted before soft freeze and has passed CI. Please review. I approve this for edk2-stable202505.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants