How do I create a sleep shortcut in macOS with a third-party keyboard?
Answer: The standard macOS Sleep shortcut is:
Command+Option+Eject
It is a convenient way to put your desktop Mac to sleep — if you have an Apple keyboard. Most third-party keyboards do not have an Eject key, which makes the Command+Option+Eject keyboard shortcut unusable.
For years, I tried several alternative methods of creating a sleep shortcut with no success. For example, I tried assigning other keys to the Eject command with third-party software. But most keyboard control interfaces, including Razer Synapse and Corsair iCUE, did not provide an assignable "Eject" key. I could assign Play, Pause, Skip, etc, but for some reason "Eject" was never an option in the media controls.
I also tried recording a Sleep macro, but putting the computer to sleep interrupted the macro recording each time. So recording a "Sleep" action was not possible.
Finally, near the end of 2020, I discovered macOS Big Sur supports custom app shortcuts. This gave me hope I could create one for the Sleep command. I tried it and it actually worked!
To create a "Sleep" keyboard shortcut in macOS 11, follow these steps.
- Open System Preferences.
- Select the Keyboard preference.
- Choose the Shortcuts option at the top.
- Click App Shortcuts from the left.
- Click the "+" symbol on the right to add a new shortcut.
- Make sure All Applications is selected.
- Type Sleep in the Menu Title field.
- Press Tab or click in the Keyboard Shortcut field to select it.
- Press your custom keyboard shortcut.
- Click Add to save the new shortcut.
That's it! Now you can use the new keyboard shortcut to put your Mac to sleep.
Choosing a Sleep Keyboard Shortcut
Since the Sleep command will interrupt anything you are doing and put your computer to sleep, choose your shortcut carefully. I recommend using at least a three-key shortcut that you will not press accidentally.
To be safe, I initially chose Command+Option+Down Arrow. But I soon realized it was annoying to use two hands to press all the keys. I changed it to Command+Option+F1, which is easier to use. It's also similar to the Command+Option+Esc shortcut that displays the Force Quit dialog box.
Finally... I don't need to press the power button on my iMac Pro or select "Sleep" from the Apple menu each time I leave my desk. I just press my custom keyboard shortcut and walk away.