keybinder

Crates.iokeybinder
lib.rskeybinder
version0.4.1
sourcesrc
created_at2022-06-27 14:41:18.029737
updated_at2022-12-12 17:15:42.441265
descriptionRust wrapper for Keybinder
homepagehttps://github.com/mdgaziur/keybinder
repositoryhttps://github.com/mdgaziur/keybinder
max_upload_size
id614170
size8,987
MD Gaziur Rahman Noor (mdgaziur)

documentation

README

Keybinder

crates.io

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();
}
Commit count: 14

cargo fmt