temporarily disable touchpad and keyboad, i.e. babyproofing my linux laptop

I found this for the keyboard, but cannot find anything for mouse :( - I will keep looking.


You could use a screen locking utility such as xlock or slock. slock is a nice simple one to use.

If you require that you can see the contents of the display, then try this command with xlock. This should keep the monitor up and lock the keyboard and mouse until you type in your password:

xlock -mode image -count 1 -bg black -fg black -geometry 0x0 -timeout 1

This wouldn't allow you to use the arrow keys, though.

EDIT:

Oddly enough, I went to google for your question and came up with a thread that I personally had posted to LinuxQuestions.org awhile ago with the EXACT same issue. You can try binding keys to acpid, but I'm not sure you can do that for basic keyboard commands...

http://www.linuxquestions.org/questions/linux-software-2/xlock-allow-certain-keys-450662/


xtrlock is worth considering. It does not have the requested capability of selecting which keys on the keyboard you want to be working, but it does allow locking the keyboard in addition to the mouse.

https://ostechnix.com/lock-keyboard-mouse-not-screen-linux/

$> sudo apt install xtrlock
$> xtrlock