Repository navigation
fix(mouse3d): recognise pucks by their declared HID usage - #482
Draft
michelhonold wants to merge 4 commits into
Draft
michelhonold wants to merge 4 commits into
michelhonold wants to merge 4 commits into
Conversation
A hidraw node is a puck when any of its hidapi entries declares Generic Desktop / Multi-axis Controller (usage page 1, usage 8) under a 3Dconnexion VID/PID (vendor 0x256f, or Logitech 0x046d within 0xc600-0xc6ff). hidapi lists one entry per top-level collection, so the node is classified across all its entries. A CadMouse, the 3Dconnexion keyboards and numpads, and the Universal Receiver's mouse interface drop out without an exclusion list. A node whose entries report no usage at all (older hidapi) is kept only when its VID/PID has a device profile. The vendor range no longer admits every 0x256f device when the profile table cannot be read; a declared puck then counts as profiled and is tried, so a broken table shows as an open error. Four models pyspacemouse has no profile for are read with a sibling's built-in profile under their own IDs and name (siblings per Blender's NDOF table and spacenavd, not yet verified on hardware): SpaceNavigator for Notebooks, the SpaceMouse Wireless receiver, the cabled SpaceMouse Pro Wireless and the SpaceMouse Module. A built-in profile for the same ID wins. Fixes #180 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A custom device_spec skips pyspacemouse's own VID/PID check, so a spec remembered per hidraw path could open another device that took the same node between two enumeration passes. open now reads the IDs of the device at the node when it opens it. Tests: a locally profiled node reporting no usage is kept and opened with its spec, an unreported unprofiled node stays quiet, and the classification parametrize is split into a usage case and a VID/PID range case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pyspacemouse whose DeviceInfo can no longer be copied with dataclasses.replace made the whole profile table unreadable, so every declared puck was tried and a puck with no profile showed as an open failure. A copy that fails now leaves only that local model unprofiled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
Review: three roundsAgent review of the whole change, fixes committed each round. Mutation checks: 22 of 23 mutants killed. The survivor removes an explicit sibling-present check, and is equivalent: the isolated copy then fails the same way. Round 1 (
Round 2 (
Round 3: nothing substantive. Accepted edge cases:
Results:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #180.
A 3D Mouse is now recognised by what it declares about itself rather than by vendor and product ID lists.
Recognition. hidapi lists one entry per HID top-level collection, so one hidraw node appears several times. A SpaceNavigator shows Generic Desktop / Multi-axis Controller (usage 1/8) plus two vendor-defined collections.
0x256f, or Logitech0x046dwithin0xc600-0xc6ff.0x256fdevice. A declared puck then counts as profiled and is tried, so a broken table shows as an open error.Readable is separate. A puck without a device profile is still reported once in the log and shown as not supported, never opened.
Local profiles. Four models pyspacemouse has no profile for are read with a sibling's built-in profile under their own IDs and name. The pairs follow Blender's NDOF table and spacenavd. Each model has its sibling's internals in a different housing, so they are not checked on hardware separately:
046d:c628046d:c626256f:c62f256f:c62e256f:c631256f:c632256f:c636256f:c635Docs.
docs/architecture/input.mdgains a "3D Mouse recognition" section; the help drawer's "Not supported" row now says the unit is a 3D Mouse.Test plan
make ci-remoteon the testing Pi.🤖 Generated with Claude Code