Expand description
§rust-wooting-sdk
This crate provides Rust bindings to the Analog and RGB SDKs provided by Wooting for the Wooting One and Wooting Two.
§Example
See the wooting-sdk/src/examples/
directory for more examples.
use wooting_sdk::{
analog::read_analog_key,
rgb::RgbKeyboard,
Key
};
let min = u8::min_value();
let max = u8::max_value();
// Check how far down W has been pressed..
match read_analog_key(Key::W)? {
min => { /* ..not pressed. */ },
max => { /* ..completely pressed. */ },
_ => { /* ..partially pressed. */ },
}
let mut keyboard = RgbKeyboard::default();
// Modify the keyboard array so QWERTY will be set to white..
keyboard.array_set_full(&[
(Key::Q, (255, 255, 255)),
(Key::W, (255, 255, 255)),
(Key::E, (255, 255, 255)),
(Key::R, (255, 255, 255)),
(Key::T, (255, 255, 255)),
(Key::Y, (255, 255, 255)),
]);
// ..and apply the change.
keyboard.array_update();
Modules§
Enums§
- Key
- Represents a key on the keyboard.
- Wooting
Error - Represents an error that can occur when querying the state of a Wooting keyboard.
Traits§
- From
Scan Index - Types that implement this trait can be associated with a scan index.
- Into
Matrix RowColumn - Types that implement this trait can be transformed into a matrix row and column.