chore: unified hotkey registration

This commit is contained in:
huzibaca
2024-09-25 15:45:12 +08:00
parent 0bacfa9286
commit 99ea6d5080
2 changed files with 3 additions and 7 deletions

View File

@@ -158,6 +158,7 @@ pub fn run() {
#[cfg(not(target_os = "macos"))]
{
log_err!(hotkey::Hotkey::global().register("Control+Q", "quit"));
log_err!(hotkey::Hotkey::global().register("Escape", "quit"));
};
}
tauri::WindowEvent::Focused(false) => {
@@ -169,6 +170,7 @@ pub fn run() {
#[cfg(not(target_os = "macos"))]
{
log_err!(hotkey::Hotkey::global().unregister("Control+Q"));
log_err!(hotkey::Hotkey::global().unregister("Escape"));
};
}
_ => {}