Skip to content

Handle kCGEventTapDisabledByTimeout#5

Open
aaronkollasch wants to merge 2 commits intosukolsak:masterfrom
JitouchApp:handle-disabled-eventtap
Open

Handle kCGEventTapDisabledByTimeout#5
aaronkollasch wants to merge 2 commits intosukolsak:masterfrom
JitouchApp:handle-disabled-eventtap

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