Skip to content

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 

Repository files navigation

🧭 Disable Internal Keyboard and Touchpad (Wayland / KDE / GNOME)

This guide permanently disables your laptop’s internal keyboard and touchpad while keeping external keyboards and mice fully functional. It uses the modern, safe method recommended by libinput and works across reboots.


🧩 Step 1 β€” Identify your internal devices

Run:

sudo libinput list-devices | grep -A5 "Device:"

Look for entries like:

Device:  AT Translated Set 2 keyboard
Kernel:  /dev/input/event3
...
Device:  FocalTechPS/2 FocalTech Touchpad
Kernel:  /dev/input/event4

Here,

  • Internal keyboard β†’ /dev/input/event3
  • Internal touchpad β†’ /dev/input/event4

βš™οΈ Step 2 β€” Create a udev rule to tell libinput to ignore them

Create a new file:

sudo vim /etc/udev/rules.d/99-ignore-internal-input.rules

Paste the following lines:

# Ignore internal keyboard
KERNEL=="event*", SUBSYSTEM=="input", ATTRS{name}=="AT Translated Set 2 keyboard", ENV{LIBINPUT_IGNORE_DEVICE}="1"

# Ignore internal touchpad
KERNEL=="event*", SUBSYSTEM=="input", ATTRS{name}=="FocalTechPS/2 FocalTech Touchpad", ENV{LIBINPUT_IGNORE_DEVICE}="1"

Save and exit (Esc β†’ :wq β†’ Enter).

Then reload udev:

sudo udevadm control --reload-rules
sudo udevadm trigger

πŸ” Step 3 β€” Reboot

Reboot your system:

sudo reboot

βœ… Step 4 β€” Verify that it worked

1. Check via libinput:

sudo libinput debug-events

You should not see:

AT Translated Set 2 keyboard
FocalTechPS/2 FocalTech Touchpad

β€” only your external keyboard/mouse devices.

2. Confirm via udev:

udevadm info -a -n /dev/input/event3 | grep LIBINPUT_IGNORE_DEVICE
udevadm info -a -n /dev/input/event4 | grep LIBINPUT_IGNORE_DEVICE

Expected output:

E: LIBINPUT_IGNORE_DEVICE=1

πŸ”“ Step 5 β€” To re-enable later

Simply comment out or delete the rule:

sudo vim /etc/udev/rules.d/99-ignore-internal-input.rules

Then reload rules and reboot:

sudo udevadm control --reload-rules
sudo udevadm trigger
sudo reboot

🧠 Notes

  • Works perfectly on Wayland (KDE, GNOME, Sway, etc.).
  • Doesn’t modify kernel drivers or /dev/input permissions.
  • 100% safe β€” the devices still exist but are invisible to libinput and all applications.
  • Survives reboots, system upgrades, and Wayland restarts.

βœ… Summary

Component Disabled? Method Safe?
Internal Keyboard βœ… LIBINPUT_IGNORE_DEVICE udev rule βœ…
Internal Touchpad βœ… LIBINPUT_IGNORE_DEVICE udev rule βœ…
External Keyboard & Mouse ❌ Unaffected βœ…

🧭 Disable Internal Keyboard and Touchpad (Wayland / KDE / GNOME)

This guide permanently disables your laptop’s internal keyboard and touchpad while keeping external keyboards and mice fully functional.

It uses the modern, safe method recommended by libinput (LIBINPUT_IGNORE_DEVICE=1) and optionally makes it conditional β€” automatically re-enabling when no external keyboard is plugged in.


🧩 Step 1 β€” Identify your internal devices

Run:

sudo libinput list-devices | grep -A5 "Device:"

Look for entries like:

Device:  AT Translated Set 2 keyboard
Kernel:  /dev/input/event3
...
Device:  FocalTechPS/2 FocalTech Touchpad
Kernel:  /dev/input/event4

Note the device names exactly as shown β€” we’ll match by those names.


βš™οΈ Step 2 β€” Create a udev rule to make libinput ignore them

Create:

sudo vim /etc/udev/rules.d/99-ignore-internal-input.rules

Paste:

# Ignore internal keyboard
KERNEL=="event*", SUBSYSTEM=="input", ATTRS{name}=="AT Translated Set 2 keyboard", ENV{LIBINPUT_IGNORE_DEVICE}="1"

# Ignore internal touchpad
KERNEL=="event*", SUBSYSTEM=="input", ATTRS{name}=="FocalTechPS/2 FocalTech Touchpad", ENV{LIBINPUT_IGNORE_DEVICE}="1"

Save (Esc :wq) and reload:

sudo udevadm control --reload-rules
sudo udevadm trigger

πŸ” Step 3 β€” Reboot

sudo reboot

βœ… Step 4 β€” Verify that it worked

1️⃣ Check that libinput ignores them:

sudo libinput debug-events

Only your external keyboard/mouse should appear β€” no β€œAT Translated Set 2 keyboard” or β€œFocalTech Touchpad”.

2️⃣ Confirm via udev:

udevadm info -a -n /dev/input/event3 | grep LIBINPUT_IGNORE_DEVICE
udevadm info -a -n /dev/input/event4 | grep LIBINPUT_IGNORE_DEVICE

Expected:

E: LIBINPUT_IGNORE_DEVICE=1

🧠 Step 5 β€” Optional: Make it conditional

(auto-re-enable internal keyboard if no external one is detected)

Create a small systemd service that dynamically enables or disables the udev rule.

sudo vim /usr/local/bin/toggle-internal-keyboard.sh

Paste:

#!/bin/bash
RULE_FILE="/etc/udev/rules.d/99-ignore-internal-input.rules"

# Detect external keyboard
if grep -qi "Keychron" /proc/bus/input/devices || grep -qi "Logitech" /proc/bus/input/devices; then
    echo "External keyboard detected β†’ keeping internal keyboard disabled."
else
    echo "No external keyboard detected β†’ re-enabling internal keyboard."
    sed -i 's/^/#/' "$RULE_FILE"
fi

# Reload udev and trigger changes
udevadm control --reload-rules
udevadm trigger

Make it executable:

sudo chmod +x /usr/local/bin/toggle-internal-keyboard.sh

Create the service:

sudo vim /etc/systemd/system/toggle-internal-keyboard.service

Paste:

[Unit]
Description=Toggle internal keyboard rule depending on external keyboard
After=graphical.target

[Service]
Type=oneshot
ExecStart=/usr/local/bin/toggle-internal-keyboard.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Enable and run:

sudo systemctl daemon-reload
sudo systemctl enable toggle-internal-keyboard.service
sudo systemctl start toggle-internal-keyboard.service

Now, on every boot:

  • If an external keyboard (e.g., Keychron, Logitech, etc.) is detected β†’ internal keyboard stays disabled.
  • If no external keyboard is present β†’ udev rule is commented out (re-enabling internal keyboard automatically).

πŸ”“ Step 6 β€” To re-enable everything manually

Just remove the rule:

sudo rm /etc/udev/rules.d/99-ignore-internal-input.rules
sudo udevadm control --reload-rules
sudo udevadm trigger
sudo reboot

βœ… Summary

Component Disabled? Controlled By Safe?
Internal Keyboard βœ… LIBINPUT_IGNORE_DEVICE udev rule βœ…
Touchpad βœ… LIBINPUT_IGNORE_DEVICE udev rule βœ…
External Keyboard & Mouse ❌ Unaffected βœ…
Conditional Toggle βš™οΈ Optional toggle-internal-keyboard.service βœ…

πŸ’‘ This is the safest, Wayland-native way to disable your laptop’s built-in keyboard and touchpad β€” no kernel tweaks, no permissions hacks, and it auto-adjusts when you connect or disconnect an external keyboard.

About

How to disable native keyboard in Wayland - KDE Neon e.g.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors