Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OS 10.14.4 restricts CGEventTapCreate #2

Open
kdemarest opened this issue May 27, 2019 · 3 comments
Open

Mac OS 10.14.4 restricts CGEventTapCreate #2

kdemarest opened this issue May 27, 2019 · 3 comments

Comments

@kdemarest
Copy link

I really, really want this beautiful fix you made, but when compile and run it in 10.14.4 it always returns with "Failed to create event tap"

I have visited System Prefs / Security & Privacy / Accessibility and added the compiled executable into the control list. Also, each time I recompiled I re-added the app, because the signature might change. Just to be sure.

Also, I have been running the executable as sudo, to make sure it had maximum privileges. Doesn't seem to help. A post seems to say that an Info.plist file is required, but I'm just not a Mac programmer so I don't know how to add one to a pure C program to try to make a fix. Here is the post: https://forums.developer.apple.com/thread/109283

Here is the failing code. I have tried changing the eventMask to be just the scroll wheel, but that didn't help.

eventTap = CGEventTapCreate(kCGHIDEventTap, kCGHeadInsertEventTap, 0, eventMask, myCGEventCallback, NULL);

if (!eventTap) {
    fprintf(stderr, "Failed to create event tap\n");
    exit(1);
}
@macegr
Copy link
Owner

macegr commented May 29, 2019

Ouch, I still haven't switched to Mojave :( I guess I would have run into this problem pretty soon, thanks for letting me know. I will leave this issue open until I get a chance to look into it, so you get a notification when it is updated.

@ohuf
Copy link

ohuf commented Apr 18, 2020

I'm also on 10.14 and I'd very much like to try that fix...
Getting the "Failed to create event tap" error as well.

@macegr
Copy link
Owner

macegr commented Jan 16, 2021

Strangely, I have been using it on 10.15 with no problems....it was still the one compiled on an earlier OS though. Will need to try it compiled on a newer OS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants