See https://alexwlchan.net/2021/04/secure-input/
#!/usr/bin/env python
"""
If macOS detects that you're typing sensitive data (e.g. a password), it prevents
other apps from reading keystrokes. This is normally a good thing, but it's mildly
annoying if you use an app like TextExpander, and macOS doesn't notice that it's
no longer using Secure Input. Then your keyboard shortcuts stop working!