5 releases (3 breaking)
0.4.1 | Dec 12, 2022 |
---|---|
0.4.0 | Jul 3, 2022 |
0.3.0 | Jul 3, 2022 |
0.2.0 | Jul 1, 2022 |
0.1.0 | Jun 27, 2022 |
#11 in #true
24 downloads per month
8KB
84 lines
Keybinder
Wraps Keybinder in a safe way
Example
use keybinder::KeyBinder;
fn main() {
gtk::init().expect("Failed to init GTK");
let data = String::from("some data");
let mut keybinder = KeyBinder::<String>::new(true).expect("Keybinder is not supported");
assert_eq!(keybinder.bind("<Shift>space", |key, data| {
println!("key: {} , data: {}", key, data);
gtk::main_quit();
}, data), true);
println!("Successfully bound keystring to handler");
gtk::main();
}
Dependencies
~44KB