Crates.io | keybinder |
lib.rs | keybinder |
version | 0.4.1 |
source | src |
created_at | 2022-06-27 14:41:18.029737 |
updated_at | 2022-12-12 17:15:42.441265 |
description | Rust wrapper for Keybinder |
homepage | https://github.com/mdgaziur/keybinder |
repository | https://github.com/mdgaziur/keybinder |
max_upload_size | |
id | 614170 |
size | 8,987 |
Wraps Keybinder in a safe way
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();
}