Crate win_hotkeys

Crate win_hotkeys 

Source
Expand description

§Win-Hotkeys

Win-hotkeys is a Rust library for creating and managing global hotkeys on Windows. It provides an ergonomic API for setting up keyboard hooks, registering hotkeys, and handling keyboard events in a safe and efficient manner.

Modules§

error
Defines the error types used throughout the crate. Errors are represented by the WHKError enum, which encapsulates various error scenarios such as invalid keys or failed hotkey registration.
hook
Provides a low-level implementation of a keyboard hook using the Windows API. It captures keyboard events such as key presses and releases, tracks the state of modifier keys, and communicates events via channels to the rest of the application.
hotkey
This module defines the Hotkey struct, which represents a keyboard hotkey. A hotkey is composed of a trigger key, one or more modifier keys, and a callback function that is executed when the hotkey is triggered.
state
This module provides the KeyboardState struct to track the state of keyboard keys. It supports key press (keydown), key release (keyup), and querying key state (is_down).

Structs§

HotkeyManager
Manages the lifecycle of hotkeys, including their registration, unregistration, and execution.
InterruptHandle
A handle for signaling the HotkeyManager to stop its event loop.
PauseHandle
A handle for signaling the HotkeyManager to stop processing hotkeys without exiting the event loop or unregistering hotkeys. When paused, the HotkeyManager will only process registered pause hotkeys.

Enums§

VKey
Represents a virtual key (VK) code.