Expand description
win_hotkey lets you register Global HotKeys for Desktop Applications.
§Example
use win_hotkey::{WinHotKeyManager, hotkey::{HotKey, Modifiers, Code}};
// initialize the hotkeys manager
let manager = WinHotKeyManager::new().unwrap();
// construct the hotkey
let hotkey = HotKey::new(Some(Modifiers::SHIFT), Code::KeyD);
// register it
manager.register(hotkey);§Processing global hotkey events
You can also listen for the menu events using WinHotKeyEvent::receiver to get events for the hotkey pressed events.
use win_hotkey::WinHotKeyEvent;
if let Ok(event) = WinHotKeyEvent::receiver().try_recv() {
println!("{:?}", event);
}Re-exports§
pub use hotkey::HotKey;
Modules§
- HotKeys describe keyboard global shortcuts.
Structs§
- Describes a global hotkey event emitted when a
HotKeyis pressed or released.
Enums§
- Errors returned by tray-icon.
- Describes the state of the
HotKey.
Type Aliases§
- Convenient type alias of Result type for tray-icon.
- A reciever that could be used to listen to global hotkey events.