1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! SpaceMouse Driver
//!
//! Cross-platform (Windows/macOS/Linux) driver for 3Dconnexion SpaceMouse and
//! compatible 3D-mouse devices. Accesses the device by raw HID capture
//! (through the [`hidapi`](https://docs.rs/hidapi) crate), thus doesn't require
//! any additional software or driver to be installed. In particular, neither
//! 3DxWare nor `spacenavd` is needed.
//!
//! The crate offers two layers:
//!
//! * [`SpaceMouse`] gives synchronous access to a device: scan for and open it,
//! read events, and set its LED. The caller drives it.
//! * [`SpaceMouseThread`] uses a [`SpaceMouse`] in a background thread (with
//! auto-reconnect logic) and delivers [`SpaceMouseEvent`]s to a callback.
//!
//! This crate deliberately knows nothing about sensitivity, inversion,
//! calibration or dead-zones. It always reports the device's raw, unscaled axis
//! readings. Data manipulation (scaling, filtering, mapping to application
//! actions, etc.) is left entirely to the caller.
//!
//! # Example
//!
//! See usage examples in [`SpaceMouse`] and [`SpaceMouseThread`].
//!
//! # Linux Device Permissions
//!
//! On Linux, `hidraw` device nodes are readable by root only by default. See
//! [`README.md`](https://github.com/LibrePCB/spacemouse-rs/blob/main/README.md)
//! for instructions to allow non-root access by installing the provided udev
//! rule.
// Fail on warnings if feature "fail-on-warnings" is enabled.
// Re-Exports
pub use SpaceMouseError;
pub use SpaceMouseEvent;
pub use SpaceMouse;
pub use SpaceMouseThread;