Skip to content

CGEventTap: Allow dropping events from callback#492

Closed
encounter wants to merge 1 commit intoservo:mainfrom
encounter:cgeventtap-drop
Closed

CGEventTap: Allow dropping events from callback#492
encounter wants to merge 1 commit intoservo:mainfrom
encounter:cgeventtap-drop

Conversation

@encounter
Copy link
Copy Markdown

This updates the return type of CGEventTapCallBackFn to allow for three options:

  • Replace returns a newly-constructed event. (equivalent to the existing Option::Some)
  • Keep returns the same event, possibly modified by the user callback. (equivalent to the existing Option::None)
  • Drop returns nullptr, stopping event propagation. (new)

@mattjbray
Copy link
Copy Markdown
Contributor

Bump. I have tested this and it works well for me.

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.

2 participants