Keypause

Press one button.
Wipe your keyboard.
Done.

Keypause is a free Mac app that switches every key off for a minute or two while you clean your keyboard, then switches them back on. Wiping presses keys, and that can close windows, quit apps or send a message you haven't finished. Until now you either shut the Mac down or hoped for the best.

Download for Mac or with Homebrew: brew install --cask destucr/tap/keypause

First time you open the download, right-click the app and choose Open

One real 30 second session, with the quiet middle sped up

What it does

Turns every key off
Letters, shortcuts, function keys and the media keys. Your mouse and trackpad keep working, so Unlock is always one click away.
Starts from anywhere
Press ⌃⌥⌘K, click the keycap in the menu bar, or run keypause start 90 in Terminal for 90 seconds.
Stays out of your way
A small panel at the top of the screen shows the countdown. It doesn't take focus, so a video keeps playing while you clean, and the screen stays awake. On a MacBook with a notch the panel grows out of it.
Always ends
You pick 30 seconds to 10 minutes. When the timer runs out the keys come back on their own. Instead of a progress bar, the panel shows a night turning to sunrise, and a little keycap character wakes up.
Keeps to itself
It never reads, stores or sends what you type. The only network request is an optional update check, once a day at most, against this project's GitHub releases.