Devices usually do not advertise their resolution and libinput relies on the udev property MOUSE_DPI for this information.[1]
It seems that #libinput will first try to find the recommended value of the device, and if that fails, will use the hard-coded value, right? No! libinput directly uses the hard-coded value and systemd-udevd only provides fixed MOUSE_DPI. Neither libinput nor #systemd-udevd has the code to read #DPI from the HID Report Descriptor.
=> More informations about this toot | More toots from coelacanthus@yuuta.moe
The exposure way and calculation method are defined in the "6.2.2.7 Global Items" section of the #USB HID spec 1.11. The general formula is
Resolution = (Logical Maximum – Logical Minimum) / ((Physical Maximum – Physical Minimum) * (10^Unit Exponent))
Unfortunately, I do not have a mouse device that exposes 'Unit Exponent' and 'Unit' for testing. Otherwise, it would be great to write a PR to #systemd or #libinput to add it.
=> More informations about this toot | More toots from coelacanthus@yuuta.moe
@coelacanthus I can check in my pile to see if I have any, though I don't remember having seen this in the past. if you want, you can just create a virtual device using UHID and implement it like that. if you are unsure about the behavior, use an stm32 and see what windows does.
=> More informations about this toot | More toots from MissingClara@chaos.social
@coelacanthus it's been a while, but you should be able to take this https://github.com/FFY00/python-uhid/blob/master/examples/simple_trio.py, change the descriptor, and then device.send_input(...) to send data.
=> More informations about this toot | More toots from MissingClara@chaos.social
@coelacanthus that said, if whot hasn't implemented this in libinput yet, I doubt there are many devices that use it in the wild, just like most of the USB HID spec, maybe one day I will finally see the mystical "magic carpet" USB HID device 🤣
=> More informations about this toot | More toots from MissingClara@chaos.social
@MissingClara Yeah. There may be only few device support it, but it will be meaningful if it benefits 1‰ of users. e.g. 3Dconnexion SpaceNavigator, see Report Descriptor in https://gitlab.freedesktop.org/libinput/libinput/-/issues/736
=> More informations about this toot | More toots from coelacanthus@yuuta.moe This content has been proxied by September (3851b).Proxy Information
text/gemini