hrvach / deskhop

Fast Desktop Switching Device
GNU General Public License v3.0
6.37k stars 185 forks source link

Unbreak relative mouse mode by adding pan to descriptor #175

Closed eltariel closed 1 week ago

eltariel commented 1 week ago

tud_mouse_report() sets pan for both absolute and relative reports but it hadn't been added to the relative mouse descriptor. This led to the host ignoring the relative reports because they didn't match the descriptor.

Additionally, moved the instance and report_id variables back into the function so it doesn't get stuck in relative mode after you send a single relative mouse report.

jalmeroth commented 1 week ago

Good catch, haven't seen this :sweat_smile:

eltariel commented 1 week ago

I use "game mode" most of the time at the moment because I'm having issues with the multi-monitor support on my macs :cry:

I've merged the two mouse reports to a common macro so they don't go out of sync again. The only differences between them are the HID_ABSOLUTE/HID_RELATIVE switch and the minimum value. It might be sensible to pull the entire X/Y pointer section out but we're still sharing the same data structure between modes so they need to be more or less identical anyway.

hrvach commented 1 week ago

Thank you so much for not just reporting but also submitting a PR. This is a very neat solution with unifying the descriptors. Any change that removes more lines than it adds gets a huge thumbs up from me!

Multi-monitor is a bit hacky, I need to set some time aside to improve it a bit.