#keyboard #api #focus

dygma_focus

Dygma focus api, for use with dygma keyboards

30 releases

0.5.1 Mar 7, 2025
0.4.19 Mar 4, 2025
0.4.11 Sep 30, 2024
0.4.9 Jul 9, 2024
0.2.4 Dec 30, 2023

#449 in Hardware support

Download history 5/week @ 2024-12-14 2/week @ 2025-02-01 2/week @ 2025-02-08 3/week @ 2025-02-15 129/week @ 2025-02-22 1071/week @ 2025-03-01 200/week @ 2025-03-08 1/week @ 2025-03-15

344 downloads per month

Custom license

220KB
3K SLoC

Dygma Focus API

crates.io

About

This crate is a Rust implementation of the Dygma Focus API.

Make sure to not have Bazecor running and connected while trying to communicate with your keyboard.

Usage

Cargo.toml

[dependencies]
dygma_focus = "0.5"

src/main.rs

use dygma_focus::prelude::*;

fn main() -> Result<(), FocusError> {
    // Open the first device found and declare as mutable
    // Other constructors are under Focus::new_*
    let mut focus = Focus::new_first_available()?;

    // Here is an example method, most have a get and set method
    // There are also other methods for triggering macros or switching layers for example
    println!("version: {}", &focus.version()?);

    Ok(())
}

Additional features

  • serde: Enables serialization
  • serde_camel_case: When serializing, the fields will be camel case

Projects using this crate

Blazecor Dygma Layer Switcher

Dependencies

~118MB
~2M SLoC