This crate provides HashMaps to look up the u32 value for a given input event code. The lazy-static crate is used so they are only created, if you used them. The codes are taken from input-event-codes.h.
There are the HashMaps ABS, BTN, EV, INPUTPROP, KEY, LED, MSC, REL, REP, SND, SW and SYN. The prefix tells you which HashMap to use. If you are looking for KEYT, you want to search in the KEY HashMap for "T". No need to repeat the prefix. There is an example on how to find the u32 value for KEYT. It's as easy as: ```Rust use inputeventcodeshashmap::KEY;
fn main() {
let keycodename = "T";
if let Some(keycodevalue) = KEY.get(keycodename) {
println!("The u32 value for {} is {}", keycodename, keycode_value);
} else {
println!("The u32 value could not be found");
}
}
You can run the example by entering the following command:
bash
cargo run --example example
```
PRs are always welcome! If I made a mistake please tell me as well :)