How I Built a GNOME Utility to Disable My Laptop Keyboard (and What I Learned About Linux Input Devices)
Description and use
KeyFlip automatically disables a laptop’s built‑in keyboard when an external keyboard is connected, using udev hotplug events and fail‑open safety.
Problem
When using an external keyboard with a laptop, accidental typing on the built‑in keyboard drains productivity and can lock users out of input.
Outcome
KeyFlip reliably disables the laptop keyboard when an external keyboard is connected, prevents accidental lockout, and runs with minimal overhead.
Workflow
- Detect built‑in keyboard via bus type and physical path
- Subscribe to udev hotplug events for real‑time device changes
- On external keyboard connect: disable built‑in keyboard if detection is confident
- On disconnect: immediately re‑enable built‑in keyboard
- Provide tray icon for manual override and status display
Evidence
KeyFlip identifies the internal keyboard by its bus type and physical path…
The result: near‑instant response when you plug in or unplug a keyboard, with essentially no idle overhead.
- Record date: 2026-09-21T07:45:33.479Z