Do you leave your keyboard unattended? Then you need to know how to lock and unlock your Mac keyboard.

Imagine a pet jumping on the keyboard, hitting the wrong keys, and deleting something you worked on for many hours. You might step away to come back and find someone else sitting at your keyboard, accessing your files without permission.

Table of Contents

    That’s why it’s important to lock your Mac keyboard if you’re stepping away, but there’s more to a locked Mac keyboard than just pressing a button, depending on your goal. We’ll explain how to do it below.

    How to Lock and Unlock Your Mac Keyboard image 1

    Can You Lock Your Mac Keyboard?

    The short answer is surprisingly no, there’s no built-in option to lock only the keyboard on your Mac. However, there are other ways to achieve a similar effect, such as locking the entire screen using your keyboard or enabling sleep mode to lock it automatically.

    How to Lock and Unlock Your Mac Keyboard image 2

    These methods will prevent any meaningful input from the keyboard until you unlock the screen with your password, Touch ID, or Apple Watch. This will also stop anyone from viewing or seeing your desktop or other open applications.

    The only way to lock your Mac keyboard while leaving the screen active is to use a third-party tool like Pristine Screen. Unlike the methods mentioned above, this won’t lock your account but will block keyboard access (mostly) until the keyboard lock is removed.

    How to Lock Your Mac Screen and Keyboard Using a Keyboard Shortcut

    The quickest way to lock your Mac screen and keyboard is to use a keyboard shortcut. This will lock your account, stop access to your desktop and open applications, and take you back to the login screen. Your password (or other authentication method) will be required to unlock your Mac keyboard afterward.

    To lock your Mac screen and keyboard, press the Control + Command + Q keys on your keyboard. This will lock your screen and keyboard instantly and take you back to login the screen.

    You can also do this via the Apple menu on the menu bar. Press the Apple logo and choose Lock Screen from the menu to lock your Mac screen and keyboard, and take you to the login screen.

    How to Lock and Unlock Your Mac Keyboard image 3

    To unlock your screen and keyboard, you’ll need to enter your password or use Touch ID. If the setting is enabled, you may also be able to unlock your Mac using your Apple Watch.

    How to Lock Your MacBook Screen and Keyboard Using the Touch Bar

    If you have a MacBook Pro with a Touch Bar, you can use the Touch Bar to lock your screen and keyboard. This option is convenient if you don’t want to remember a keyboard shortcut or use the mouse to lock your screen or keyboard.

    To do this, follow these steps.

    1. First, press the Apple menu > System Settings.
    How to Lock and Unlock Your Mac Keyboard image 4
    1. In System Settings, press Keyboard.
    2. Select the Touch Bar Settings button.
    How to Lock and Unlock Your Mac Keyboard image 5
    1. In the pop-up menu, make sure that Expanded Control Strip is selected for the Touch bar shows option. This will ensure that the Touch Bar always has the lock icon visible.
    2. Press Done.
    How to Lock and Unlock Your Mac Keyboard image 6
    1. Next, tap the lock icon next to the Esc key on the Touch Bar. This will lock your screen and keyboard immediately, taking you to the login screen.
    How to Lock and Unlock Your Mac Keyboard image 7
    1. To unlock your screen and keyboard afterward, enter your password or use your other authentication methods (such as Touch ID or your Apple Watch) to unlock your device.

    How to Set Your Mac to Lock Your Screen and Keyboard Automatically

    Want to make sure your Mac keyboard always locks? You can set your screen inactivity settings to do this for you. When your Mac screen goes blank, your system will lock—you must type in your password to begin using it again.

    This is a useful setting to play if you want to save energy while securing your Mac automatically. However, you’ll need to ensure the feature is enabled in your Mac settings first. To do this, follow these steps.

    1. First, press the Apple logo in the top-left and select System Settings.
    How to Lock and Unlock Your Mac Keyboard image 8
    1. Next, press Lock Screen.
    2. Set the Require password immediately after screen saver begins or display is turned off value to Immediately.
    3. Set the Turn display off on battery when inactive and Turn display off on power adapter when inactive values for a short period (like 1 minute).
    4. You’ll be asked to confirm your new settings. Type in your username and password to confirm, then press Modify Settings.
    How to Lock and Unlock Your Mac Keyboard image 9
    1. Close the System Settings window.

    To lock your screen and keyboard automatically, stop moving your mouse or trackpad and leave your keyboard untouched. After the period of inactivity you’ve set in System Settings is passed, your screen will go dark. When you move the mouse or press a key, you must type your password in again to begin using your Mac.

    How to Use a Third-Party App to Lock Your Mac Keyboard

    The three methods above, strictly speaking, don’t actually lock the keyboard entirely. Instead, they keep you logged in while preventing access to your account, limiting what can actually be achieved with your keyboard.

    If you want to lock your Mac keyboard in the truest sense (to limit any key presses from being recorded), you’ll need to use a third-party application. Several exist for this purpose, but one useful option in the App Store is a free app called Pristine Screen.

    Pristine Screen allows you to temporarily lock your keyboard to limit any key presses from being recorded. You can perform certain tasks, such as cleaning your Mac keyboard, before unlocking it again. However, Pristine Screen doesn’t lock your screen, so it offers less security than the built-in methods above.

    To use Pristine Screen to lock your Mac keyboard, follow these steps.

    1. Download and install Pristine Screen from the App Store on your Mac.
    2. Once installed, launch the Pristine Screen app from the Applications folder in the Finder app or via the Dock.
    How to Lock and Unlock Your Mac Keyboard image 10
    1. In the Pristine Screen window, press the Start Cleaning Session button. This will launch the app in full screen and lock your keyboard, blocking almost all keyboard presses from being registered.
    How to Lock and Unlock Your Mac Keyboard image 11
    1. To unlock your screen and keyboard, press and hold the Space bar for three seconds. This will exit the Pristine Screen lock, exiting the app from full screen and restoring keyboard access.
    How to Lock and Unlock Your Mac Keyboard image 12

    Securing Your Mac Keyboard

    While there isn’t a built-in switch to turn your keyboard on or off, you can easily lock your screen and your keyboard on your Mac using the steps above. Alternatively, use a third-party app like Pristine Screen to add the functionality to your Mac instead.

    Worried about your macOS security? It might be time to update the password on your Mac to something stronger. If you can’t sign in, you can always reset your Mac admin password to restore access afterward.