fix: preserve forwarded mouse DPI metadata during injection#1290
Conversation
- keep the forwarded device name identical to the source device so system mouse hwdb rules still match - assign a dedicated input-remapper phys path to forwarded devices so they stay distinguishable without reusing the original hardware phys - add a udev rule that restores ID_BUS for forwarded devices before 70-mouse.rules runs, allowing MOUSE_DPI to be applied - prevent autoload and device discovery from treating input-remapper-created devices as real hardware - update tests and local uinput mocks to cover forwarded phys handling and input-remapper device filtering
- remove the old input-remapper device group from reader tests now that discovery skips synthetic devices - format forwarded phys assertions to satisfy black
d6b991e to
1d8e946
Compare
- expose phys as an explicit UInputMock argument - keep the forwarded-device skip test aligned with find filtering semantics
|
Thanks! I addressed the two inline comments in 89709c3:
All checks are passing on the latest commit. About the linked pointer-speed issues: I would not claim this PR fixes all of them yet. This specifically fixes the case where the forwarded virtual mouse loses hwdb-derived metadata such as For reports caused by missing |
|
I think include_inputremapper can be removed from both filter and find |
- remove the unused filter and find flag now that input-remapper devices are skipped during discovery - update reader publishing and group tests to use the simplified API
|
Done, thanks. I removed Since input-remapper-created devices are now skipped during discovery, the extra flag is no longer needed there. I also updated the reader client and group tests to use the simplified API. 5251c11 only fixes the resulting black formatting issue in |
|
I just tried your changes locally, and mouse speed correctly stays the same (Kubuntu 25.10). I am happy about the code comments and that you also worked on the tests. Just one more thing, probably: Now that filter doesn't filter anything anymore, lets rename it to get_groups. Then I think I'll merge this. |
- reflect that the method now returns discovered groups without additional filtering - update GUI callers and group tests
|
Done, thanks. I renamed All checks are passing on the latest commit. |
Summary
This fixes a pointer feel regression when injecting mouse devices.
Before this change, the forwarded virtual mouse created by input-remapper
could lose hwdb-derived properties such as
MOUSE_DPI. On devices like theLogitech G Pro, that caused the injected pointer to feel different from the
original device even though the event capabilities were copied.
What changed
mouse hwdb rules can still match
input-remapper/...phys path to forwarded devices sothey remain distinguishable without reusing the original hardware phys
ID_BUSfor forwarded devices before70-mouse.rulesruns, allowingMOUSE_DPIto be applieddevices as real hardware
input-remapper device filtering
Why
On my system, enabling injection for a Logitech G Pro changed the effective
pointer curve/DPI feel. Inspecting the injected device showed that the
forwarded virtual mouse was missing the original device's
MOUSE_DPImetadata.
After this patch, the forwarded device keeps the original device name, gets
ID_BUS=usb, and successfully receives the sameMOUSE_DPIvalue as thephysical mouse.
Verification
Manual verification on Linux with a Logitech G Pro:
before the patch, the forwarded device had no
MOUSE_DPIafter the patch, both the physical device and the forwarded device expose:
MOUSE_DPI=400@1000 *800@1000 1600@1000 3200@1000 6400@1000pointer feel is now indistinguishable during injection in real use
Notes
I also observed unrelated instability in the local test environment on
Python 3.14, but the DPI/metadata fix itself was validated on the real
device.