mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-05 12:29:44 +08:00
improvement(shortcut): Supports Option + Space on Mac
Supports the Option (⌥) + Space shortcut, as it's the default shortcut for ChatGPT Desktop app to show popup.
This commit is contained in:
parent
8f3e17a003
commit
cfc9c42c8d
@ -715,7 +715,7 @@
|
|||||||
},
|
},
|
||||||
"shortcuts": {
|
"shortcuts": {
|
||||||
"action": "Action",
|
"action": "Action",
|
||||||
"alt_warning": "Mac does not support Option + letters as shortcuts",
|
"alt_warning": "On Mac, Option key combinations only work with the Space key",
|
||||||
"clear_shortcut": "Clear Shortcut",
|
"clear_shortcut": "Clear Shortcut",
|
||||||
"clear_topic": "Clear Messages",
|
"clear_topic": "Clear Messages",
|
||||||
"copy_last_message": "Copy Last Message",
|
"copy_last_message": "Copy Last Message",
|
||||||
|
|||||||
@ -715,7 +715,7 @@
|
|||||||
},
|
},
|
||||||
"shortcuts": {
|
"shortcuts": {
|
||||||
"action": "操作",
|
"action": "操作",
|
||||||
"alt_warning": "MacではOption + 文字をショートカットとして使用できません",
|
"alt_warning": "MacではOptionキーとの組み合わせは、スペースキーのみ使用可能です",
|
||||||
"clear_shortcut": "ショートカットをクリア",
|
"clear_shortcut": "ショートカットをクリア",
|
||||||
"clear_topic": "メッセージを消去",
|
"clear_topic": "メッセージを消去",
|
||||||
"copy_last_message": "最後のメッセージをコピー",
|
"copy_last_message": "最後のメッセージをコピー",
|
||||||
|
|||||||
@ -714,7 +714,7 @@
|
|||||||
},
|
},
|
||||||
"shortcuts": {
|
"shortcuts": {
|
||||||
"action": "Действие",
|
"action": "Действие",
|
||||||
"alt_warning": "Mac не поддерживает Option + буквы как горячие клавиши",
|
"alt_warning": "В Mac сочетания с клавишей Option работают только с пробелом",
|
||||||
"clear_shortcut": "Очистить сочетание клавиш",
|
"clear_shortcut": "Очистить сочетание клавиш",
|
||||||
"clear_topic": "Очистить все сообщения",
|
"clear_topic": "Очистить все сообщения",
|
||||||
"copy_last_message": "Копировать последнее сообщение",
|
"copy_last_message": "Копировать последнее сообщение",
|
||||||
|
|||||||
@ -715,7 +715,7 @@
|
|||||||
},
|
},
|
||||||
"shortcuts": {
|
"shortcuts": {
|
||||||
"action": "操作",
|
"action": "操作",
|
||||||
"alt_warning": "Mac 系统不能使用 Option + 字母作为快捷键",
|
"alt_warning": "Mac 系统中 Option 键只能与空格键组合使用",
|
||||||
"clear_shortcut": "清除快捷键",
|
"clear_shortcut": "清除快捷键",
|
||||||
"clear_topic": "清空消息",
|
"clear_topic": "清空消息",
|
||||||
"copy_last_message": "复制上一条消息",
|
"copy_last_message": "复制上一条消息",
|
||||||
|
|||||||
@ -714,7 +714,7 @@
|
|||||||
},
|
},
|
||||||
"shortcuts": {
|
"shortcuts": {
|
||||||
"action": "操作",
|
"action": "操作",
|
||||||
"alt_warning": "Mac 不能使用 Option + 字母作為快捷鍵",
|
"alt_warning": "Mac 系統中 Option 鍵只能與空白鍵組合使用",
|
||||||
"clear_shortcut": "清除快捷鍵",
|
"clear_shortcut": "清除快捷鍵",
|
||||||
"clear_topic": "清除所有訊息",
|
"clear_topic": "清除所有訊息",
|
||||||
"copy_last_message": "複製上一条消息",
|
"copy_last_message": "複製上一条消息",
|
||||||
|
|||||||
@ -59,7 +59,8 @@ const ShortcutSettings: FC = () => {
|
|||||||
const hasModifier = keys.some((key) => ['Control', 'Ctrl', 'Command', 'Alt', 'Shift'].includes(key))
|
const hasModifier = keys.some((key) => ['Control', 'Ctrl', 'Command', 'Alt', 'Shift'].includes(key))
|
||||||
const hasNonModifier = keys.some((key) => !['Control', 'Ctrl', 'Command', 'Alt', 'Shift'].includes(key))
|
const hasNonModifier = keys.some((key) => !['Control', 'Ctrl', 'Command', 'Alt', 'Shift'].includes(key))
|
||||||
|
|
||||||
if (isMac && keys.includes('Alt')) {
|
// only allows option + space
|
||||||
|
if (isMac && keys[0] === 'Alt' && !['Space', undefined].includes(keys[1])) {
|
||||||
window.message.warning({
|
window.message.warning({
|
||||||
content: t('settings.shortcuts.alt_warning'),
|
content: t('settings.shortcuts.alt_warning'),
|
||||||
key: 'shortcut-alt-warning'
|
key: 'shortcut-alt-warning'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user