Repository navigation
Match the X2A family's hidraw node on PID too - #17
Conversation
With the X3 cabled and the 1K dongle still plugged in, find_hidraw() returned the dongle's interface 1, since both are VID 3710 and hidraw1 sorts before hidraw11. After a swap to the cable the DPI button went unheard. Same VID+PID match nordic.py already uses.
#17 fixed x2a.py: matching the hidraw node on the VID alone picks whichever node sorts first, so with an X3 cabled and the 1K dongle still plugged in the listener sat on the dongle and the DPI button went unheard. nordic.py already matched on VID and PID. feinmann8k.py did not - it matched the VID as a substring of the whole uevent file - and it shares VID 0x3710 with every mouse that triggered this, so it had the same bug waiting. Rather than a third copy of the same loop, the matching moves to PulsarDevice.find_hidraw() and each driver declares which interface carries its reports: _HIDRAW_INTERFACE = '/input1' find_hidraw() takes a `root`, which is what makes this testable: the new check in tools/check-drivers.py builds a sysfs tree holding every declared VID:PID at once - a mouse, its dongle, and someone else's Pulsar, the situation no single desk reproduces - and asserts each driver picks its own device's node. The node numbering keeps the lexicographic sort the bug relied on (hidraw1 before hidraw11), and every device gets an input0 node too, so a driver that stopped checking the interface fails as well. Fault-injected to confirm the check is worth having: restoring the VID-only match fails it on seven drivers and exits non-zero. The feinmann8k change is the one nobody can test - that model is harveywuk's and no one here has one. It is strictly narrower than what it replaces, and the comment there says where to look if its events ever stop arriving. Verified on the X2A: find_hidraw() still returns /dev/hidraw5, the same node as before, and check-drivers is 8/8.
|
Merged, thanks — and it was latent on the X2A too: I took the match up into _HIDRAW_INTERFACE = '/input1'
On the stage byte: the X2A is 0-based, so the So this wants an override in |
|
Ran it on both connections. It's 1-based the whole way round on both. Six presses each, same table (400/800/1600/3200/6400/12800): So the dongle passes the same 1-based byte through, which means A few other things showed up in the logs, in case they're useful for #7:
Also, a59543f stops the GUI's listeners from starting on every driver: no DPI updates in the tray and no Connection Quality on Home. Details and a fix in #19. |
The X2A's DPI button reports its six stages as bytes 0x00 to 0x05, so the parser added one and every Sonix driver inherited that. The X3 reports 0x01 to 0x06 for the same six stages - @f-o-o-g-s pressed it six times on the cable and six more through the 1K dongle and got the identical table both ways (#17), and six presses of the X2A's own button here walked 0x00..0x05, so the difference is real and not a misread. Left as it was, the X3 showed the next stage up in the tray and in Input Test, and its top stage showed as a seventh that does not exist. The dongle relays the mouse's byte untouched, so it needs the same answer as whatever mouse is behind it; the X3 is the only one confirmed there. The Xlite v4 keeps the X2A's numbering, as it keeps everything else about the X2A - that driver has never been run against hardware. Its docstring now says this is a thing to check if its DPI button reads one stage high.
|
Both tables land on 1–6 now. The dongle is the guess of the three. It relays the mouse's byte untouched, so the numbering is really the mouse's, and the X3 is the only mouse confirmed behind it. If a Fusion2 mouse turns up that counts from zero, that constant has to become a The Xlite v4 keeps the X2A's 0, like everything else in that driver; it has never met hardware. Its docstring now points here if its DPI button ever reads one stage high. The other three report shapes are worth more than a comment on a merged PR — #21. |
With the X3 on its cable and the 1K dongle still plugged in, the DPI button stopped reaching the app after a swap to the cable.
find_hidraw()in x2a.py only checks the VID, and the Fusion2 mice and the 1K dongle all share 3710, so it returned the dongle's interface 1 (hidraw1sorts beforehidraw11).This copies the VID+PID match nordic.py already does. It covers the X2A, Xlite v4, X3 and the 1K dongle since they all inherit it.
Tested with my X3 and 1K dongle, app running as my user:
hidraw1and presses went nowhere. After, it's onhidraw11and presses come through (800, 1600)hidraw1, all 6 presses heardcheck-drivers.py: 7/7feinmann8k.py's
find_hidraw()has the same VID-only match. I don't have that dongle so I left it out, but it's the same change if you want it.