Comment

Comment by traceroute66

I'm sorry but this is the ultimate definition of a solution looking for a problem.

Sorry you've wasted your time coding this because in reality the solution is already built into macOS: enable the "require passsword after screen saver begins" setting in system preferences.

When you need to clean the keyboard, just activate your screensaver (easily done via configuring a hot-spot). Job done.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton