How to disable input device under Linux

Let me take you through a journey where I did what I do best, break things.

I was tinkering with the keyboard code and as you might know, you can use the DevTerm keyboard on your PC, I uploaded a code where I introduced a bug where I had few keys pressed and they didn’t release, which resulted connecting the keyboard to my PC = disabling all kind of inputs on my PC.

I couldn’t even click upload to reflash the keyboard with the fixed code, so I figured out I could leave how I dealt with that, in case it happens to someone else.

Create a config under X11 xorg:

sudo nano /usr/share/X11/xorg.conf.d/99-disable-cpi-kbd.conf

add the following:

Section "InputClass"
   Identifier         "Disable DevTerm Keyboard"
   MatchProduct       "ClockworkPI DevTerm"
   Option             "Ignore" "on"
EndSection

Restart X11 and you should be good to go.

Now your Linux OS won`t accept input from the device and you can still flash it by DFU.

2 Likes