From 9b17416f9c8939b65446ee61a70ab59420841380 Mon Sep 17 00:00:00 2001 From: xiaotianxt Date: Thu, 27 Feb 2025 13:37:11 +0800 Subject: [PATCH] fix: remove restrictions on mac alt+x shortcuts Restrictions are introduced in earlier beta versions of MacOS Sequoia. However, in the public release, Apple revoke this restrictions. Alt+[Char] shortcut has no restrictions now. --- src/renderer/src/i18n/locales/en-us.json | 1 - src/renderer/src/i18n/locales/ja-jp.json | 1 - src/renderer/src/i18n/locales/ru-ru.json | 1 - src/renderer/src/i18n/locales/zh-cn.json | 1 - src/renderer/src/i18n/locales/zh-tw.json | 1 - src/renderer/src/pages/settings/ShortcutSettings.tsx | 9 --------- 6 files changed, 14 deletions(-) diff --git a/src/renderer/src/i18n/locales/en-us.json b/src/renderer/src/i18n/locales/en-us.json index dd12ef58..0d9fa15f 100644 --- a/src/renderer/src/i18n/locales/en-us.json +++ b/src/renderer/src/i18n/locales/en-us.json @@ -786,7 +786,6 @@ }, "shortcuts": { "action": "Action", - "alt_warning": "On Mac, Option key combinations only work with the Space key", "clear_shortcut": "Clear Shortcut", "clear_topic": "Clear Messages", "copy_last_message": "Copy Last Message", diff --git a/src/renderer/src/i18n/locales/ja-jp.json b/src/renderer/src/i18n/locales/ja-jp.json index 56fead70..65c46b2e 100644 --- a/src/renderer/src/i18n/locales/ja-jp.json +++ b/src/renderer/src/i18n/locales/ja-jp.json @@ -786,7 +786,6 @@ }, "shortcuts": { "action": "操作", - "alt_warning": "MacではOptionキーとの組み合わせは、スペースキーのみ使用可能です", "clear_shortcut": "ショートカットをクリア", "clear_topic": "メッセージを消去", "copy_last_message": "最後のメッセージをコピー", diff --git a/src/renderer/src/i18n/locales/ru-ru.json b/src/renderer/src/i18n/locales/ru-ru.json index 71d276b9..05a1c5bc 100644 --- a/src/renderer/src/i18n/locales/ru-ru.json +++ b/src/renderer/src/i18n/locales/ru-ru.json @@ -786,7 +786,6 @@ }, "shortcuts": { "action": "Действие", - "alt_warning": "В Mac сочетания с клавишей Option работают только с пробелом", "clear_shortcut": "Очистить сочетание клавиш", "clear_topic": "Очистить все сообщения", "copy_last_message": "Копировать последнее сообщение", diff --git a/src/renderer/src/i18n/locales/zh-cn.json b/src/renderer/src/i18n/locales/zh-cn.json index 682bb7c8..75445164 100644 --- a/src/renderer/src/i18n/locales/zh-cn.json +++ b/src/renderer/src/i18n/locales/zh-cn.json @@ -786,7 +786,6 @@ }, "shortcuts": { "action": "操作", - "alt_warning": "Mac 系统中 Option 键只能与空格键组合使用", "clear_shortcut": "清除快捷键", "clear_topic": "清空消息", "copy_last_message": "复制上一条消息", diff --git a/src/renderer/src/i18n/locales/zh-tw.json b/src/renderer/src/i18n/locales/zh-tw.json index 27a2c9e3..bedd6374 100644 --- a/src/renderer/src/i18n/locales/zh-tw.json +++ b/src/renderer/src/i18n/locales/zh-tw.json @@ -786,7 +786,6 @@ }, "shortcuts": { "action": "操作", - "alt_warning": "Mac 系統中 Option 鍵只能與空白鍵組合使用", "clear_shortcut": "清除快捷鍵", "clear_topic": "清除所有訊息", "copy_last_message": "複製上一条消息", diff --git a/src/renderer/src/pages/settings/ShortcutSettings.tsx b/src/renderer/src/pages/settings/ShortcutSettings.tsx index 9d8cdb28..e2db129e 100644 --- a/src/renderer/src/pages/settings/ShortcutSettings.tsx +++ b/src/renderer/src/pages/settings/ShortcutSettings.tsx @@ -59,15 +59,6 @@ const ShortcutSettings: FC = () => { const hasModifier = keys.some((key) => ['Control', 'Ctrl', 'Command', 'Alt', 'Shift'].includes(key)) const hasNonModifier = keys.some((key) => !['Control', 'Ctrl', 'Command', 'Alt', 'Shift'].includes(key)) - // only allows option + space - if (isMac && keys[0] === 'Alt' && !['Space', undefined].includes(keys[1])) { - window.message.warning({ - content: t('settings.shortcuts.alt_warning'), - key: 'shortcut-alt-warning' - }) - return false - } - return hasModifier && hasNonModifier && keys.length >= 2 }