Skip to content

Commit

Permalink
improvement(shortcut): Supports Option + Space on Mac
Browse files Browse the repository at this point in the history
Supports the Option (⌥) + Space shortcut, as it's the default shortcut for ChatGPT Desktop app to show popup.
  • Loading branch information
luwux authored and kangfenmao committed Feb 17, 2025
1 parent b4aaf05 commit 93e28ed
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/renderer/src/i18n/locales/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
},
"shortcuts": {
"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_topic": "Clear Messages",
"copy_last_message": "Copy Last Message",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/i18n/locales/ja-jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
},
"shortcuts": {
"action": "操作",
"alt_warning": "MacではOption + 文字をショートカットとして使用できません",
"alt_warning": "MacではOptionキーとの組み合わせは、スペースキーのみ使用可能です",
"clear_shortcut": "ショートカットをクリア",
"clear_topic": "メッセージを消去",
"copy_last_message": "最後のメッセージをコピー",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/i18n/locales/ru-ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@
},
"shortcuts": {
"action": "Действие",
"alt_warning": "Mac не поддерживает Option + буквы как горячие клавиши",
"alt_warning": "В Mac сочетания с клавишей Option работают только с пробелом",
"clear_shortcut": "Очистить сочетание клавиш",
"clear_topic": "Очистить все сообщения",
"copy_last_message": "Копировать последнее сообщение",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/i18n/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
},
"shortcuts": {
"action": "操作",
"alt_warning": "Mac 系统不能使用 Option + 字母作为快捷键",
"alt_warning": "Mac 系统中 Option 键只能与空格键组合使用",
"clear_shortcut": "清除快捷键",
"clear_topic": "清空消息",
"copy_last_message": "复制上一条消息",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/i18n/locales/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@
},
"shortcuts": {
"action": "操作",
"alt_warning": "Mac 不能使用 Option + 字母作為快捷鍵",
"alt_warning": "Mac 系統中 Option 鍵只能與空白鍵組合使用",
"clear_shortcut": "清除快捷鍵",
"clear_topic": "清除所有訊息",
"copy_last_message": "複製上一条消息",
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/pages/settings/ShortcutSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ 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))

if (isMac && keys.includes('Alt')) {
// 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'
Expand Down

0 comments on commit 93e28ed

Please sign in to comment.