Skip to content

mdgaziur/keybinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();
}

Releases

No releases published

Packages

No packages published

Languages