On my Mac (running Ventura), so long as my app is granted accessibility permission in System Settings > Privacy & Security > Accessibility, I am able to create a global event tap like so:
CFMachPortRef thePort = CGEventTapCreate(
kCGAnnotatedSessionEventTap,
kCGTailAppendEventTap,
kCGEventTapOptionDefault, // active filter
CGEventMaskBit(kCGEventKeyDown),
CTapListener::MyTapCallback,
NULL );
But on a user's computer, also running Ventura, the CGEventTapCreate
call is apparently returning NULL, even though he's showing me a screen shot of the accessibility permission being turned on. Any ideas what I could be missing, or how to debug it?