Skip to main content

zmk_studio_api/
lib.rs

1//! High-level Rust client for the ZMK Studio RPC protocol.
2//!
3//! The recommended API surface is:
4//! - [`StudioClient`] for RPC operations
5//! - [`Behavior`] for typed key bindings
6//! - [`HidUsage`] and [`Keycode`] for ZMK key values
7//! - [`transport`] for BLE/serial I/O adapters
8//!
9//! [`proto`] exposes raw generated protobuf types for advanced use cases.
10
11mod binding;
12mod client;
13mod framing;
14mod hid_usage;
15mod keycode;
16/// Raw generated protobuf types used by the RPC protocol.
17pub mod proto;
18mod protocol;
19#[cfg(feature = "python")]
20mod python;
21/// Transport adapters for connecting to a ZMK Studio-capable device.
22pub mod transport;
23
24/// Typed key binding value used by [`StudioClient::get_key_at`] and [`StudioClient::set_key_at`].
25pub use binding::Behavior;
26/// Errors returned by high-level client operations.
27pub use client::{ClientError, StudioClient};
28/// Decoded ZMK HID usage values used in typed behavior APIs.
29pub use hid_usage::{
30    HID_USAGE_KEYBOARD, HidUsage, MOD_LALT, MOD_LCTL, MOD_LGUI, MOD_LSFT, MOD_RALT, MOD_RCTL,
31    MOD_RGUI, MOD_RSFT,
32};
33/// ZMK keycode enum used in typed behavior APIs.
34pub use keycode::Keycode;