Skip to content

z3k-io/windows-key-listener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Windows Key Listener

A Rust library for global keyboard event listening and hotkey management on Windows.

Usage

use windows_key_listener::KeyListener;
use std::{sync::Arc, time::Duration};

fn main() {
    let listener = KeyListener::new();

    // Register shortcuts
    key_listener.listen(
        "Ctrl + Shift + A", 
        Duration::from_millis(200),
        Arc::new(|| {
            on_key_pressed();
            false   // Return true to block the event
        })
    );

    run_your_app();
    
    key_listener.unlisten();
}

Installation

Add this to your Cargo.toml:

[dependencies]
windows-key-listener = "x.y.z"

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

Rust library for global keyboard event listening on Windows.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages