Medius - BindingsOverview

Bindings

Drive the box from C, C++, or Python

A medius box sits inline between a mouse and a PC: the real device passes through untouched, and your program injects input of its own over a USB-serial link. These bindings let you write that program in C / C++ or Python instead of Rust. They cover the whole feature set and put the exact same bytes on the wire.

        your program   ( C / C++ / Python )
                       │
        ┌──────────────▼──────────────┐
        │      language binding       │   ◀ these pages
        └──────────────┬──────────────┘
                       │   C ABI · medius.h + libmedius_capi
        ┌──────────────▼──────────────┐
        │     medius (Rust core)      │   ◀ the client library
        └──────────────┬──────────────┘
                       │   4 Mbaud USB-serial frames
        ┌──────────────▼──────────────┐
        │       the medius box        │   ▶ mouse + game PC
        └─────────────────────────────┘

C and C++ are one binding: the C header (medius.h) compiles as both, so a C++ program includes it and calls the same functions. If you're new to medius, start with the Quickstart for what the box does; these pages link to the Rust Library and Native API for what each command means.

Languages

Same capabilities, different ergonomics
LanguageInstallErrorsCleanupReach for it when
Pythonpip install mediusraises MediusErrorautomatic (with / GC)scripting, automation, fast prototyping
C / C++download the prebuilt libraryreturns MediusStatusmanual (*_free)a C or C++ app, embedding, a base for another FFI

Coverage

Every box feature, in every language
CapabilityC / C++Python
Connect, find, clone the link
Move & wheel
Inject buttons, keys, media
Lock physical input
Catch live input (streams)
Buffered clip playback
Options & LED
Queries (version, health, caps…)
Mock box (testing)build flagbuild flag
Flash firmwarebuild flagbuild flag
Asyncsync only. Build it on the stream timeouts (see each Streams page)

Mock and flash are off by default; each binding's Build & features page shows how to turn them on.