'CGEventPost fails to deliver keyboard events to another process under Catalina (Mac OSX 10.15)

We have a little QA helper program (called keysim) using CGEventCreateKeyboardEvent and CGEventPost to feed functions keys to the application under test. This did work great until the current Mac OSX version (10.15). Now the program does simply have no effect when the application under test has the focus (and the QA test fails). Any pointers why this happens and how this could be resolved?



Solution 1:[1]

I did add the keysim app under System Preferences > Security and Privacy > Privacy > Developer Tools (The info says : Allow the apps below to run software locally that does not meet the systems security policy).

And this made the function key invocation successful.

IMHO The info is misleading : Our keysim program doesn't run software. The info for Accessibility says: Allow the apps below to control your computer. So that's why I tried that instead of "Developer Tools". Never mind: problem solved.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Leo