I'm completely stuck with logic that's been working for many years now. I'm using this to listen to keyboard events (hotkeys) while the app is in background.
CFMachPortRef eventTap = CGEventTapCreate(kCGSessionEventTap,
kCGHeadInsertEventTap,
kCGEventTapOptionDefault,
CGEventMaskBit(kCGEventKeyDown) | CGEventMaskBit(kCGEventFlagsChanged),
myCGEventCallback,
nil);
if (!eventTap) {
printf("error: event tap register failed\n");
return false;
}
The code has not changed, and this has worked for a long time until the latest update to mojave. How can I go about troubleshooting the reason for this? Would anyone know how I can get this working again?