Key Logging Under Catalina While Locked

Hi!


My app wants to intercept/receive user keystrokes while the app is running and the macOS computer is locked. However, when the computer is locked, my code receives the first keystroke by the user, then the login window appears, and then even if the login window disappears the code does not receive any subsequent keystroke from the user. Only when the computer is unlocked and then locked again does my app receive any subsequent keystroke from the user.


This behavior was not present on Mojave or High Sierra.


Is this a Catalina security policy? No error is provided - my code is using IOKit routines to setup callbacks to receive user keypresses. I have attempted to reinitialize all the IOKit objects/callbacks while in the background but that did not result in my app receiving subsequent keystrokes.


My app doesn't record the keys - it only notes the time at which it's told a key was pressed.


Thanks,


Karl