wineventhook
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() {
let (event_tx, mut event_rx) = tokio::sync::mpsc::unbounded_channel();
let hook = WindowEventHook::hook(
EventFilter::default(),
event_tx,
).await.unwrap();
while let Some(event) = event_rx.recv().await {
println!("{:#?}", event);
}
hook.unhook().await.unwrap();
}
License
Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT)