mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 17:15:38 +08:00
fix: parse hotkey (#5167)
* fix: incorrectly parse hotkey * refactor: parse hotkey * fix: panic on linux * chore: update * chore: update style * fix: register hotkey error on windows * chore: update style --------- Co-authored-by: Tunglies <tunglies.dev@outlook.com>
This commit is contained in:
@@ -676,7 +676,14 @@ async fn create_tray_menu(
|
||||
.filter_map(|item| {
|
||||
let mut parts = item.split(',');
|
||||
match (parts.next(), parts.next()) {
|
||||
(Some(func), Some(key)) => Some((func.into(), key.into())),
|
||||
(Some(func), Some(key)) => {
|
||||
// 托盘菜单中的 `accelerator` 属性,在 Linux/Windows 中都不支持小键盘按键的解析
|
||||
if key.to_uppercase().contains("NUMPAD") {
|
||||
None
|
||||
} else {
|
||||
Some((func.into(), key.into()))
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user