Skip to content

Instantly share code, notes, and snippets.

@luckygoswami
Created May 22, 2025 03:51
Show Gist options
  • Select an option

  • Save luckygoswami/247fc6fbbfdaa54e76a56b4b4b69a9d9 to your computer and use it in GitHub Desktop.

Select an option

Save luckygoswami/247fc6fbbfdaa54e76a56b4b4b69a9d9 to your computer and use it in GitHub Desktop.
Enable/Disable Laptop Keyboard via Windows Registry

Enable/Disable Laptop Keyboard via Windows Registry

Manually control your built-in PS/2 keyboard by modifying the i8042prt registry key. Useful for:

  • Disabling faulty keyboards
  • Troubleshooting stuck keys
  • Switching to external keyboards permanently

πŸ“ Registry Values Explained

Value Name Behavior Recommended Use
0 Boot Loads during boot sequence Critical drivers
1 System Loads during kernel initialization Normal keyboard operation (Default)
2 Auto Loads when needed Rarely used
3 Manual Loads only when manually triggered May cause instability
4 Disabled Prevents driver loading Permanently disable keyboard

πŸ›  How to Modify

Method 1: Manual Registry Edit

  1. Press Win + R, type regedit, hit Enter
  2. Navigate to:
    Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt
    
  3. Double-click Start and modify the value

Method 2: Registry Scripts (.reg files)

Enable Keyboard (Default)

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt]
"Start"=dword:00000001

Disable Keyboard

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt]
"Start"=dword:00000004

πŸš€ Usage Instructions

  1. Save the desired code as .reg file (e.g., disable_keyboard.reg)
  2. Right-click β†’ "Merge"
  3. Accept UAC prompt
  4. Restart your computer

⚠ Important Notes

  1. Always backup your registry before making changes:
    • In regedit: File β†’ Export
  2. Effects:
    • Only impacts PS/2 keyboards (most built-in laptop keyboards)
    • USB/external keyboards remain unaffected
  3. Troubleshooting:
    • If keyboard stops responding, use On-Screen Keyboard (Win + Ctrl + O)
    • To reset completely, delete the Start value and reboot

πŸ”„ Reverting Changes

To restore Windows default behavior:

  1. Delete the Start value completely, OR
  2. Set it to 1 (System)
  3. Reboot

πŸ€” FAQ

Q: Why was my original value 3?
A: Some third-party keyboard utilities set this, but it may cause instability. Recommend using 1 (enabled) or 4 (disabled).

Q: Will this affect BIOS/keyboard during boot?
A: No, this only affects Windows driver loading after OS boots.

Q: What if my keyboard uses a different driver?
A: Check Device Manager β†’ Keyboards for alternate drivers like HID Keyboard Device.

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt]
"Start"=dword:00000004
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt]
"Start"=dword:00000001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment