smed-client 0.1.0

Client for smed, the SpaceMouse Enterprise driver daemon (JSON-lines API)
Documentation
  • Coverage
  • 49.12%
    28 out of 57 items documented1 out of 17 items with examples
  • Size
  • Source code size: 29.1 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 320.8 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • thomschlie/smed
    1 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • thomschlie

smed-client

Client for smed, a Linux driver daemon for the 3Dconnexion SpaceMouse Enterprise.

smed owns the device and reports it to any number of clients over a Unix socket at $XDG_RUNTIME_DIR/smed/api.sock, in JSON lines. It reports the six raw axes, every key by its 3Dconnexion button ID with short or long press, and the rotation lock, which clients can also set. This crate holds the message types both sides use, the table of key names and a small blocking client. The protocol is specified in docs/api.md.

use smed_client::{Client, ServerMessage};

let mut client = Client::connect("example")?;
while let Some(message) = client.next_message()? {
    if let ServerMessage::Key { key, press, down, .. } = message {
        println!("{key} {press:?} {}", if down { "down" } else { "up" });
    }
}

Not affiliated with or endorsed by 3Dconnexion.

Licence

MIT or Apache-2.0, at your option.