Skip to content

Instantly share code, notes, and snippets.

@maimere
Last active March 24, 2025 00:23
Show Gist options
  • Save maimere/6a94065acdf1b601df060d6c45fb42d1 to your computer and use it in GitHub Desktop.
Save maimere/6a94065acdf1b601df060d6c45fb42d1 to your computer and use it in GitHub Desktop.
How to disable built-in laptop keyboards

If the built-in keyboard of your laptop is short-circuited, for example, it is desirable that it is disabled even before the Display Manager, for it might cause trouble on the user/password input.

I am assuming:

  1. You use the linux kernel.
  2. You use grub.

These instructions will help disabling the driver of the built-in keyboard directly on the kernel, via grub.

Usually, the built-in keyboard is managed by the i8042 module, which manages PS/2 keyboards and mice.

Sometimes, the built-in keyboard is wired as an internal USB device, so it is managed by the module usbhid.

In lucky cases, the module is proprietary. Here be dragons.

Keyboard managed by i8042 module:

  1. Edit /etc/default/grub. Root privileges needed.

  2. Find the GRUB_CMDLINE_LINUX_DEFAULT variable.

  3. Add the parameter i8024.nokdb.

For example:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8024.nokdb"

Check the kernel documentation for more information on parameters: https://docs.kernel.org/admin-guide/kernel-parameters.html

Mind that i8042.nokbd does not affect USB keyboards nor other PS/2 devices, only the PS/2 keyboard.

  1. Make sure to save the changes.

  2. Reboot.

Keyboard managed by usbhid module:

soon

Keyboard managed by proprietary module:

Do you have a laptop with proprietary modules for the built-in keyboard? It may happen on MacBooks, ThinkPads or gamer laptops. Help me feeding this section with specific information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment