![Apple logo.](https://i-blog.csdnimg.cn/blog_migrate/2552d3e8311b3ef9d714ab507e5bfd4c.png)
Frustrated because there’s not a keyboard shortcut for a command you constantly use in a Mac app? You can create one in System Preferences!
沮丧是因为在Mac应用程序中没有经常使用的命令的快捷键吗? 您可以在“系统偏好设置”中创建一个!
First, click the Apple icon in the upper-left corner, and then select “System Preferences.”
首先,单击左上角的Apple图标,然后选择“系统偏好设置”。
![Click the Apple icon, and then select "System Preferences."](https://i-blog.csdnimg.cn/blog_migrate/68cc99e84fb879979f260040e6b45740.png)
In “System Preferences,” click “Keyboard,” and then click the “Shortcuts” tab.
在“系统偏好设置”中,单击“键盘”,然后单击“快捷方式”选项卡。
![Click "Shortcuts" in the "Keyboard" menu.](https://i-blog.csdnimg.cn/blog_migrate/fc0645306defe29762da1c66e4a55413.png)
Click “App Shortcuts” in the sidebar.
点击边栏中的“应用程序快捷方式”。
![Click "App Shortcuts."](https://i-blog.csdnimg.cn/blog_migrate/6a820ff9ce5908ab5c276dbb7aa29181.png)
Click the plus sign (+) to add a new shortcut.
单击加号(+)添加新的快捷方式。
![Click the plus sign (+) to add a keyboard shortcut.](https://i-blog.csdnimg.cn/blog_migrate/d5c531863778ba65b71d3f0be6566a24.png)
A new window containing a drop-down menu and two text fields will appear. Click the dropdown labeled “Application” and select the Application for which you want to create a shortcut (we chose “Pages”).
将会出现一个包含下拉菜单和两个文本字段的新窗口。 单击标有“应用程序”的下拉菜单,然后选择要为其创建快捷方式的应用程序(我们选择了“页面”)。
![Select the application you want to have a keyboard shortcut.](https://i-blog.csdnimg.cn/blog_migrate/61f239ca352f430ee486feceabff0513.png)
Next, open the app and look for the exact name of the menu command you want to turn into a shortcut. We chose “Page Thumbnails” from the “View” menu, as it doesn’t already have a keyboard shortcut.
接下来,打开应用程序,并查找您要变成快捷方式的菜单命令的确切名称。 我们从“查看”菜单中选择了“页面缩略图”,因为它还没有键盘快捷键。
![We clicked "View" and "Page Thumbnails" to create a keyboard shortcut.](https://i-blog.csdnimg.cn/blog_migrate/2d3e89bed158b18028a2a87f6234b963.png)
Return to the keyboard shortcut entry window and type in the exact name of the menu command you want to turn into a shortcut in the “Menu Title” box.
返回键盘快捷方式输入窗口,然后在“菜单标题”框中键入要转换为快捷方式的菜单命令的确切名称。
Then, click the “Keyboard Shortcut” box and type the shortcut you want to use to trigger it. We chose Shift+Command+K because it wasn’t already taken.
然后,单击“键盘快捷方式”框,然后键入要用于触发它的快捷方式。 我们选择Shift + Command + K是因为尚未使用它。
You can use almost any combination of Command, Option, and Control with any number, letter, or character key. You can also use Shift to make a unique combination.
您几乎可以将Command,Option和Control与任何数字,字母或字符键结合使用。 您还可以使用Shift进行独特的组合。
![Type the name of the menu command in the "Menu Title" box and the shortcut you want to use in the "Keyboard Shortcut" box.](https://i-blog.csdnimg.cn/blog_migrate/7e2f18bedd964d2ccc26cf659679f061.png)
Click “Add” and the popup will close. You’ll now see your shortcut listed in the “Keyboard” preferences. In the app, you should also see your new shortcut in the drop-down menu next to its associated command.
点击“添加”,弹出窗口将关闭。 现在,您会在“键盘”首选项中看到您的快捷方式。 在应用程序中,您还将在其相关命令旁边的下拉菜单中看到新的快捷方式。
![A keyboard shortcut next to "Page Thumbnails" in the "View" menu in "Pages."](https://i-blog.csdnimg.cn/blog_migrate/bced0c7dc9eaae02cae6d443d521fffe.png)
From now on, whenever you press that key combination, the menu item you chose will be triggered.
从现在开始,每按一次该组合键,就会触发您选择的菜单项。
If you want to remove a custom shortcut later, just revisit System Preferences > Keyboards > Shortcuts, select the custom shortcut in the list, and then press the minus sign (-).
如果以后要删除自定义快捷方式,只需重新访问系统偏好设置>键盘>快捷方式,在列表中选择自定义快捷方式,然后按减号(-)。
自定义Mac快捷方式提示 (Custom Mac Shortcut Tips)
![Creating a "Compress" shortcut for "All Applications" in Keyboard Preferences on Mac.](https://i-blog.csdnimg.cn/blog_migrate/f36625b8c879d18668a5136523c46284.png)
Keep the tips below in mind whenever you’re creating keyboard shortcuts:
创建键盘快捷键时,请记住以下提示:
When creating a shortcut, you must use the exact name of a menu item. This includes any capitalization, spaces, or punctuation.
创建快捷方式时,必须使用菜单项的确切名称。 这包括任何大写字母,空格或标点符号。
The key combination you specify must be unique. If there’s a duplicate, one of the functions won’t execute properly.
您指定的组合键必须唯一。 如果重复,其中一个功能将无法正确执行。
If the keyboard shortcut you want to use is taken, try adding Shift, Control, or both. For example, instead of Command+V (which is reserved for pasting text), you could use Shift+Control+Command+V.
如果采用了您要使用的键盘快捷键,请尝试添加Shift和/或Control。 例如,可以使用Shift + Control + Command + V代替Command + V(保留用于粘贴文本)。
You can make universal keyboard shortcuts. Just select “All Applications” from the “Applications” list. Your shortcut will then work in any app that has the same menu item you type.
您可以设置通用键盘快捷键。 只需从“应用程序”列表中选择“所有应用程序”。 然后,您的快捷方式将可在具有与您键入的菜单项相同的任何应用程序中使用。
“Rename,” “Compress,” and “Bring All to Front” would all make useful shortcuts. These would come in handy for window management in many apps. “Compress” works in Finder, but it also might in other programs.
“重命名”,“压缩”和“全部显示在最前面”都是有用的快捷方式。 这些将在许多应用程序中方便进行窗口管理。 “压缩”可以在Finder中使用,但在其他程序中也可以。
Keyboard shortcuts are a powerful feature to have in your Mac arsenal. Browse your favorite apps, and see what you come up with!
键盘快捷键是Mac军械库中的一项强大功能。 浏览您喜欢的应用程序,然后看看您会想到什么!
翻译自: https://www.howtogeek.com/683469/how-to-create-custom-keyboard-shortcuts-for-any-mac-app/