chore: unified hotkey registration

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

No files matched your search

+2
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"));
};
}
_ => {}