If you have a USB wired keyboard you can just unplug the thing while cleaning, but those of us who use wireless keyboards usually must take the batteries out to turn the keyboard off, which I never do.

The free tiny app KeyboardClean Tool locks down your keyboard until you click on the app's button with your mouse.

This ensures you can clean you keyboard while on without accidentally deleting half your work.

For Windows users check out Kid-Key-Lock, a similar program we covered a few years ago that can also lock down your mouse with your keyboard.

KeyboardClean was created by the same developer as Better Touch Tool a great little app that adds tons of gestures to your mouse.

KeyboardCleanTool BetterTouchTool, BetterSnapTool & SecondBar