I'm sharing 2 bash scripts I made that use the xinput command to enable/disable the keyboard or the laptop touchpad. While you can find (sure better) similar scripts or apps that achieve the same results, or create aliases of xinput with parameters and save them in your ~.bash_aliases file, these shared scripts could be helpful to Linux newbies that are learning command line (those really exist? ), and besides ... these scripts do work
To execute add the execution permission to each script ( $ chmod u+x script name )
The scripts can be run at the command line ( $ bash script name ) or add them to your MATE menu as additional items (this will show a notification on your desktop).
I remember somebody disabling the keyboard in his laptop to cleaning it and after that, re-enabling it. Because the script donโt disable the mouse, if you already added the KbOnOff script as an item in your MATE menu, all you need is click on the menu launcher. I use the KbOnOff script on a HP laptop that have the internal keyboard damaged because a water spill; I attached an external keyboard to the laptop and the script do not affect it.