1 unstable release
0.1.0 | Feb 16, 2022 |
---|
#5 in #razer
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
~2.2–3MB
~62K SLoC