wineventhook

Crates.iowineventhook
lib.rswineventhook
version0.9.0
sourcesrc
created_at2022-03-03 02:43:36.629284
updated_at2024-02-06 22:21:49.151145
descriptionA rusty wrapper over SetWinEventHook and UnhookWinEvent.
homepagehttps://github.com/OpenByteDev/wineventhook-rs
repositoryhttps://github.com/OpenByteDev/wineventhook-rs
max_upload_size
id542706
size73,390
OpenByte (OpenByteDev)

documentation

https://docs.rs/wineventhook

README

wineventhook

CI crates.io Documentation dependency status MIT

A rusty wrapper over SetWinEventHook and UnhookWinEvent.

Example

This example shows how to listen for all window events and print them to the console.

use wineventhook::{EventFilter, WindowEventHook};

#[tokio::main]
async fn main() {
    // Create a new hook
    let (event_tx, mut event_rx) = tokio::sync::mpsc::unbounded_channel();
    let hook = WindowEventHook::hook(
        EventFilter::default(),
        event_tx,
    ).await.unwrap();
    
    // Wait and print events
    while let Some(event) = event_rx.recv().await {
        println!("{:#?}", event);
    }
    
    // Unhook the hook
    hook.unhook().await.unwrap();
}

License

Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT)

Commit count: 38

cargo fmt