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

Handle kCGEventTapDisabledByTimeout #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aaronkollasch
Copy link

If Accessibility permissions are revoked while Jitouch is running, the system UI no longer responds to mouse clicks or key presses. This is due to Jitouch's CGEventTap callback that receives user input events but cannot pass them along due to a lack of permissions. For more about this issue see aaronkollasch#5.

After a delay, the OS normally detects the CGEventTap has timed out and sends a kCGEventTapDisabledByTimeout event to Jitouch's CGEventCallback. However, this event was ignored, allowing Jitouch to continue dropping all mouse and keyboard events.

With this pull request, if CGEventCallback receives a kCGEventTapDisabledByTimeout event, it will trigger Jitouch to remove the CGEventTap and try to create another for 5 minutes, then exit if one still can't be created.

This PR supersedes #2.

See:

After a delay, the OS will detect the CGEventTap has timed out and will send a
kCGEventTapDisabledByTimeout event. This event will now trigger an exit().
CGEventCallback will attempt to recreate the CGEventTap
@Crazor Crazor deleted the handle-disabled-eventtap branch December 28, 2022 21:42
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

Successfully merging this pull request may close these issues.

1 participant