How to prevent "allow input monitoring" dialog

Hello,

I created a Java program and bundled it with Install4J to a "real" macOS application. When I start the app on macOS 11.x , I get the "allow input monitoring" dialog.

a) What triggers this dialogue? I'm pretty sure I'm not "asking" for it. What functions do I have to avoid in my programme so that the dialogue does not appear in the first place?
b) How do I configure my app bundle so that the dialogue is not displayed? (I really don't need input monitoring)

My preferred search engine only found questions from users who want to configure the system settings. But no hints for me as a developer who wants to avoid this dialogue.

Thanks in advance
Niels
This privacy alert is triggered by various APIs that are capable of ‘seeing’ input events that occur outside of your app. The example I used for testing this stuff is CGEvent taps but there are other, similar APIs that will also trigger the alert. I’m pretty sure that both the I/O Kit HID API and Accessibility API can trigger this, but I don’t have relevant experience with either of those APIs.

If you were using Apple APIs directly my advice would be to step through your code to see what call actually triggers alert. In your case, however, that’s unlikely to work. Your best option is to ask your third-party tools vendor why they’re triggering this.

For more background on this feature, see WWDC 2019 Session 701 Advances in macOS Security.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
How to prevent "allow input monitoring" dialog
 
 
Q