#hid #razer #devices #usb-device #command #driver #native

razer_driver_rs

Implementation of razer device USB commands

1 unstable release

0.1.0 Feb 16, 2022

#7 in #razer

LGPL-3.0-only

40KB
771 lines

Razer Driver for Rust

A native rust library to communicate with Razer USB devices directly without any of the Razer software.

Work in Progress

This project is missing many many features. However the framework is there to easily add anything missing.

Contributions are very welcome.

Example

use razer_driver_rs::*;

let devices = scan_for_devices()?;
let keyboard = devices.keyboards.get(0).unwrap();
let brightness = keyboard.get_brightness()?;
println!("brightness {}", brightness);
keyboard.set_brightness(90)?;

Credits

This library is very heavily inspired by:


lib.rs:

Provides an interface for interacting with Razer devices.

Abstracts the USB HID interface and the data structure of the communication protocol.

Example

A basic example would be

use razer_driver_rs::*;

let devices = scan_for_devices()?;
let keyboard = devices.keyboards.get(0).unwrap();
let brightness = keyboard.get_brightness()?;
println!("brightness {}", brightness);
keyboard.set_brightness(90)?;

Dependencies

~1.4–2.4MB
~43K SLoC