PristineTouch is a macOS app for disabling your input devices temporarily — perfect for cleaning your keyboard without having to shut down!
Start the app PristineTouch, your screen will show symbol and keyboard & mouse/trackpad have been disabled.
If you are running PristineTouch for the first time, you may need to grant it accessibility access. Usually, macOS will show a system dialog with instructions to do so. If it does not, go to System Preferences > Security & Privacy > Privacy > Accessibility and grant PristineTouch access.
PristineTouch creates an event tap to disable input. If you are running software that detects (and possibly terminates) programs doing this, you might need to whitelist PristineTouch.
This program does not automatically clean your keyboard. It only assists in the process of doing so.