Deactivate Built-in Devices (USB/PS2, Event, etc.) – Lenovo Built-in Keyboard

ls* etc commands show you usb devices connected

# ls
ls           lsb_release  lshw         lsirq        lsmem        lsof         lsusb
lsattr       lscpu        lsinitramfs  lslocks      lsmod        lspci
lsblk        lsfd         lsipc        lslogins     lsns         lspgpot

But actually, I was able to find my keyboard. A command can also be helpful for discovering it, as it only shows USB devices.

# head /sys/bus/hid/drivers/*/*/*/*/name

Evtest is a useful tool, and it can be leveraged to capture and block events.

evtest (tool must be install via apt)

$ evtest

No device specified, trying to scan all of /dev/input/event*
Available devices:
...
/dev/input/event0:      AT Translated Set 2 keyboard
/dev/input/event1:      Wacom Pen and multitouch sensor Pen
/dev/input/event11:     ThinkPad Extra Buttons
/dev/input/event14:     TPPS/2 Elan TrackPoint
...

To block events form this devices execute

$ evtest --grab /dev/input/event0 > /dev/null &
evtest --grab /dev/input/event1 > /dev/null &
evtest --grab /dev/input/event11 > /dev/null &
evtest --grab /dev/input/event14 > /dev/null &

Release you build in Keybards

$ killall -9 evtest
Lenovo P1 No keys Lenovo P1 No Keybard keys working Lenovo P1 No Keybard keys working anymore

Why it can be usefull?

For example, if the built-in keyboard with a trackpoint on a notebook stops working properly—like what happened to me—there’s often no real solution except replacing it. On my Lenovo P1 Gen2, after three years of use, some keys (like “v”) only work sporadically.

Of course, I will replace the keyboard (very bad, Lenovo!), but for now, I’ve placed an external keyboard on top of my laptop. However, this unintentionally presses the built-in keys and trackpoint, causing issues. Disabling the built-in keyboard has made me happy again!

sources: