Minimal example:
// rdev 0.5.3
use rdev::{Keyboard, KeyboardState, EventType, Key};
#[cfg(windows)]
fn main() {
let mut keyboard = Keyboard::new().unwrap();
keyboard.add(&EventType::KeyPress(Key::CapsLock));
keyboard.add(&EventType::KeyRelease(Key::CapsLock));
let a = keyboard.add(&EventType::KeyPress(Key::KeyA));
assert_eq!(a, Some(String::from("A")));
}
The Keyboard cannot recognize CapsLock states.