TechBuzzPro

Disable the Sleep Keyboard Button in Windows – Quick Guide

· 6 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can disable the Sleep button on a Windows keyboard by removing its function in Device Manager or by changing the Power Options, which stops accidental sleep mode and keeps your PC running when you don’t want it to pause.

What You'll Need

  • Administrator access on the Windows computer
  • A keyboard that has a dedicated Sleep key (often labeled with a crescent moon)
  • Basic familiarity with Windows Settings and Device Manager

Step-by-Step

  1. Open Device Manager. Press Win+X and choose Device Manager from the menu. On some versions the menu label may read Windows Power User Menu.
  2. Locate the keyboard device. In Device Manager expand the Keyboards category. You will see one or more entries such as Standard PS/2 Keyboard or the name of a USB keyboard.
  3. Open the keyboard's properties. Right‑click the appropriate entry and select Properties.
  4. Go to the "Power Management" tab. If the tab is not present, the keyboard driver does not expose power‑management options; skip to step 7.
  5. Uncheck "Allow this device to wake the computer". This prevents the keyboard from sending any wake‑up signal, which includes the Sleep key.
  6. Click OK and close Device Manager. The change takes effect immediately; test the Sleep key – it should no longer put the PC to sleep.
  7. If the Power Management tab is missing, use the Power Options method.
    1. Open Settings by pressing Win+I.
    2. Navigate to System > Power & battery (on Windows 11 the path is System > Power).
    3. Click Additional power settings on the right side to open the classic Control Panel view.
    4. In the Power Options window, click Choose what the power buttons do on the left.
    5. Click Change settings that are currently unavailable to enable the greyed‑out options.
    6. Find the row labeled Sleep button (this controls the physical Sleep key on many keyboards). Change both "On battery" and "Plugged in" to Do nothing.
    7. Press Save changes. The Sleep key now behaves like a regular key with no power‑state effect.
  8. Optional: Disable the key through the Registry. Advanced users can remap the Sleep key to “No Operation” using the Registry Editor:
    1. Press Win+R, type regedit and press Enter.
    2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout.
    3. Create a new binary value named Scancode Map.
      • Right‑click the right pane, choose New > Binary Value, name it Scancode Map.
      • Double‑click the value and enter the following data (hex): 00 00 00 00 00 00 00 00 02 00 00 00 00 00 5E E0 00 00 00 00. This maps the Sleep scancode (E0 5E) to null.
    4. Close Registry Editor and restart the computer for the change to take effect.

    Be aware that editing the registry incorrectly can make the system unstable. Only proceed if you are comfortable creating a system restore point first.

Common Mistakes

Many users try to disable the Sleep key by simply removing the physical keycap or covering it with tape. While that stops accidental presses, it does not prevent the key signal from being sent, and the system will still interpret the press if the key is triggered by a shortcut or macro. Another frequent error is editing the wrong registry path – the Keyboard Layout key must be edited under HKEY_LOCAL_MACHINE, not under HKEY_CURRENT_USER. Changing the wrong entry can disable other keys or cause the computer not to recognize the keyboard at all.

Some people disable the Sleep button in Power Options but forget to click “Change settings that are currently unavailable.” If that step is skipped, the Sleep button row remains greyed out and the change cannot be saved, leaving the original behavior unchanged.

Tips

  • Create a System Restore point before touching the registry. Search for "Create a restore point" in the Start menu, select your system drive, and click Create.
  • If you have a laptop, the Sleep function may also be tied to the power button itself. The same Power Options page lets you set the power button to "Do nothing" if you want to disable both.
  • Use a third‑party key‑remapping tool such as PowerToys (official Microsoft utility) to reassign the Sleep key to a harmless function without editing the registry.
  • After making changes, test the key in a low‑risk environment (e.g., a blank Notepad document) to confirm it no longer triggers sleep.
  • On some keyboards the Sleep key is part of a multifunction key (Fn+F1, etc.). In that case you may need to disable the Fn‑layer shortcut in the keyboard’s proprietary software rather than Windows settings.

Troubleshooting

If the Sleep key still puts the PC to sleep:

  1. Restart the computer. Some changes, especially those made in Device Manager, require a reboot to become active.
  2. Verify that you edited the correct keyboard entry. USB keyboards often appear as "HID Keyboard Device" while built‑in laptops show "Standard PS/2 Keyboard".
  3. Check for duplicate entries. A second entry for the same physical keyboard can still have the wake‑up flag enabled.
  4. Make sure the Power Options page you edited corresponds to the active power plan. Switch to the plan you are actually using (e.g., "Balanced") before changing the Sleep button action.
  5. If you used the registry method, open regedit again and confirm the Scancode Map value exactly matches the hex string provided. A missing byte or extra space will cause Windows to ignore the map.
  6. Run sfc /scannow from an elevated Command Prompt to repair any corrupted system files that might prevent power‑management settings from applying.
  7. As a last resort, uninstall the keyboard driver from Device Manager (right‑click → Uninstall device) and let Windows reinstall it on the next reboot. This resets any hidden power‑management flags.

Remember that disabling the Sleep key does not affect other ways the system can enter sleep, such as closing the lid on a laptop or selecting "Sleep" from the Start menu.

Frequently Asked Questions

Can I re‑enable the Sleep key later?

Yes. Reverse the steps: re‑check "Allow this device to wake the computer" in Device Manager, set the Sleep button back to its default action in Power Options, or delete the Scancode Map value and reboot.

Will disabling the Sleep key affect the Windows shortcut Win+X?

No. The Sleep key uses a distinct hardware scancode (E0 5E). Changing its mapping does not interfere with other keyboard shortcuts.

Do I need third‑party software to disable the Sleep key?

Not at all. Windows provides built‑in methods via Device Manager, Power Options, and the Registry. Third‑party tools are optional and can offer a graphical interface if you prefer.

Does this work on macOS?

macOS does not expose a dedicated Sleep key in the same way Windows does. The closest equivalent is the Power button or the Apple menu “Sleep”. To prevent accidental sleep on a Mac you would adjust System Settings > Battery > Power Button, not a keyboard key.

My laptop still sleeps when I press the key even after following the guide. What else could be causing it?

Some manufacturers implement a hardware‑level sleep function that bypasses Windows settings. Check the laptop’s vendor‑specific utility (e.g., Dell Power Manager, Lenovo Vantage) for a “Sleep key” option and disable it there.

Will disabling the Sleep key affect the ability to put the PC to sleep using the Start menu?

No. The Start menu uses a software command that is independent of the hardware Sleep key, so you can still put the computer to sleep when you want.