medius 3.4.6

Rust library for Medius, replacement firmware for the MAKCU box
Documentation

medius

Crates.io Docs CI License Discord

The Rust library for Medius, replacement firmware for the MAKCU box. It drives a box over its USB-serial control port: inject mouse, keyboard and media input, lock or scale native input, catch the traffic through the box, play clips and update the firmware.

Install Medius · Dashboard · Docs · Stock vs Medius · Discord

Install

cargo add medius
Feature Adds
async AsyncDevice: async queries, on any runtime
mock MockBox: a fake box for tests without hardware
tracing tracing events: the handshake, frames, queries, reconnects, chip restarts and the box's LOG lines

Usage

use medius::{Button, Device, Result};

fn main() -> Result<()> {
    let device = Device::find()?;            // first box found, protocol checked
    println!("{}", device.query_version()?);
    device.move_rel(100, -50)?;
    device.press(Button::LEFT)?;
    device.release(Button::LEFT)?;
    device.reset()?;                         // back to passthrough
    Ok(())
}

Device is Send + Sync and cheap to clone. A command returns as soon as its frame is sent; a query waits for the reply. The crate reconnects by itself. After a reconnect or a box restart, it restores held keys and buttons, locks, rules, transforms and subscriptions.

Other languages

Language Install Docs
C, C++ medius.h and the library from a release C / C++
Python pip install medius Python

AI agents

Every docs page is served as Markdown (add .md to its URL), indexed in llms.txt, and exposed by a read-only MCP server:

claude mcp add --transport http medius-docs https://medius.k4tech.net/mcp

Examples

cargo run --example basic                    # needs a box
cargo run --example hw_full --all-features   # every feature on hardware (Linux)

License

MIT, see LICENSE.