Crate win_hotkey

Source
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§

Modules§

  • HotKeys describe keyboard global shortcuts.

Structs§

Enums§

Type Aliases§

  • Convenient type alias of Result type for tray-icon.
  • A reciever that could be used to listen to global hotkey events.