Capturing Keyboard Input on macOS
TIL in the name of security it’s now very difficult for your app to capture keystokes on macOS. I’m working on something for fun that involves capturing keystrokes from a keyboard in python. This seems to work fine on my personal computers (which are all running Ubuntu) but when I tried to run the same thing on macOS it didn’t work.
According to the docs I should have been able to get keystrokes provided I was running as root (via sudo) but that didn’t work either. Trying to add python to the accessibility list didn’t work either as it’s not a packaged / signed macOS app.