Support 3D mice on Linux and devices that send all six axes in report 1 (#343)
The space_mouse module was Windows-only (hidapi). On Linux it now finds the multi-axis HID interface through /sys/class/hidraw and reads /dev/hidrawN with plain std I/O, so there is no new dependency and no libudev needed. A small report descriptor parser tells devices apart: a top-level Multi-Axis Controller collection marks the 3D mouse, and report 1 declaring all six axes selects the combined layout (X Y Z Rx Ry Rz in one report) that some homemade devices use. Real split devices (report 1 translation, report 2 rotation) keep their existing decoding. Windows reads the descriptor through hidapi and falls back to the split layout if it is unavailable. Co-authored-by: jochenhammes <15869208+jochenhammes@users.noreply.github.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
6 files changed
+464
-26
No files matched your search
@@ -19,9 +19,11 @@ serde_json = { workspace = true }
|
||||
log = { workspace = true }
|
||||
rfd = { workspace = true }
|
||||
|
||||
[target.'cfg(any(target_os = "windows", target_os = "linux"))'.dependencies]
|
||||
quick-xml = { workspace = true }
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
hidapi = { version = "2.6.7", default-features = false, features = ["windows-native"] }
|
||||
quick-xml = { workspace = true }
|
||||
|
||||
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
|
||||
winit = { version = "0.30", default-features = false, features = ["x11"] }
|
||||
|
||||
Reference in new issue
Block a user