| Crates.io | wineventhook |
| lib.rs | wineventhook |
| version | 0.10.0 |
| created_at | 2022-03-03 02:43:36.629284+00 |
| updated_at | 2025-11-30 00:53:42.958055+00 |
| description | A rusty wrapper over SetWinEventHook and UnhookWinEvent. |
| homepage | https://github.com/OpenByteDev/wineventhook-rs |
| repository | https://github.com/OpenByteDev/wineventhook-rs |
| max_upload_size | |
| id | 542706 |
| size | 69,812 |
A rusty wrapper over SetWinEventHook and UnhookWinEvent.
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();
}
Licensed under MIT license (LICENSE or http://opensource.org/licenses/MIT)