If the computer is on and you want to clean the mouse or keyboard without shutting down the system, check out Toddler Trap.
It’s a free utility that will temporarily disable the mouse and all keys of your computer keyboard so you can safely clean the hardware without having to worry about making any accidental clicks. It may also be used to lock the track pad of a laptop prior to cleaning.
While it is possible to lock a computer by hitting the Windows + L keyboard shortcut, the advantage with Toddler Trap is that it doesn’t change your screen so if you are watching a video on YouTube or listening to some music, you can clean the computer parts in parallel.
Once you are done with the cleaning, hit the lone close button to reactivate the mouse and keyboard.