Opened 16 months ago

Closed 9 months ago

Last modified 8 months ago

#860 closed defect (fixed)

Lenovo mouse up motion not working correctly

Reported by: Jiri Svoboda Owned by:
Priority: major Milestone: 0.14.1
Component: helenos/drv/usbmouse Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

When I pass my wireless Lenovo mouse (i.e., wireless USB receiver device) directly to HelenOS in Qemu, it does not work 100%.

Most things work, but when I move the mouse a little bit up, the cursor jumps all the way to the top of the screen. Movement in other directions, as well as buttons work fine.

I don't have another USB mouse on hand to try.

Change History (4)

comment:1 by Jiri Svoboda, 14 months ago

I compared the behavior for different USB mice and Lenovo wireless was the only one that didn't work:

Reproduced VID:PID Description
NO xxxx:yyyy Qemu virtual USB mouse
NO 046d:c019 Fujitsu-Siemens rebranded Logitech optical wired USB mouse
NO 17ef:600e Lenovo wired optical wheel mouse
YES 17ef:604d Lenovo wireless mouse

comment:2 by Jiri Svoboda, 9 months ago

Root cause

usb_hid_translate_data() is used to extract motion data from USB HID report. A bug in bit extraction code meant that the code only worked if the field was actually byte-aligned. Lenovo wireless mouse reports X and Y motion as 12-bit signed integers. The value of the X axis (the first one) was byte-aligned, but the second on started in the middle of the byte and it was mangled, instead of 0xfff (-1) we got 0xf0f (-241). That moved the mouse very quickly upwards.

Fixed in changeset dd19446847b88a7d55adaaa3e465bec939a3e4a9

comment:3 by Jiri Svoboda, 9 months ago

Resolution: fixed
Status: newclosed

comment:4 by Jiri Svoboda, 8 months ago

Milestone: 0.13.10.14.1

Milestone renamed

Note: See TracTickets for help on using tickets.