Crates.io | msw-hotkey |
lib.rs | msw-hotkey |
version | 0.2.1 |
source | src |
created_at | 2022-05-06 00:48:58.499706 |
updated_at | 2022-05-07 14:39:58.196618 |
description | A hotkey library for Microsoft Windows |
homepage | |
repository | https://github.com/DaSeinUndZeit/msw-hotkey |
max_upload_size | |
id | 581379 |
size | 18,025 |
A hotkey library for Microsoft Windows
use msw-hotkey::Hotkey
// https://github.com/microsoft/windows-rs
// https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/UI/Input/KeyboardAndMouse/fn.RegisterHotKey.html
use windows::Win32::UI::Input::KeyboardAndMouse::RegisterHotKey
// https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/UI/Input/KeyboardAndMouse/struct.HOT_KEY_MODIFIERS.html
use windows::Win32::UI::Input::KeyboardAndMouse::HOT_KEY_MODIFIERS;
fn main()
{
let hotkey = Hotkey::from_str("ctrl + a");
unsafe {
RegisterHotkey(Win32::Foundation::HWND(0) , 1 ,HOT_KEY_MODIFIERS(hotkey.modifier()), hotkey.key() as u32);
}
}