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
WHKErrorenum, 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
Hotkeystruct, 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
KeyboardStatestruct to track the state of keyboard keys. It supports key press (keydown), key release (keyup), and querying key state (is_down).
Structs§
- Hotkey
Manager - Manages the lifecycle of hotkeys, including their registration, unregistration, and execution.
- Interrupt
Handle - A handle for signaling the
HotkeyManagerto stop its event loop. - Pause
Handle - A handle for signaling the
HotkeyManagerto stop processing hotkeys without exiting the event loop or unregistering hotkeys. When paused, theHotkeyManagerwill only process registered pause hotkeys.
Enums§
- VKey
- Represents a virtual key (VK) code.