core-foundation-rs icon indicating copy to clipboard operation
core-foundation-rs copied to clipboard

Cancel event when `CGEventTap` callback returns nullptr

Open adamnemecek opened this issue 1 year ago • 4 comments

Fixes #664. The fix is taken from https://github.com/tinyx3k/goxkey/blob/38f66edeb65e12a496a50fc700c89492b6215c94/src/platform/macos_ext.rs#L196C5-L213C6

This is absolutely necessary to filter events. Looking around github, returning NULL is a very common use case.

adamnemecek avatar Apr 05 '24 17:04 adamnemecek

See also https://github.com/servo/core-foundation-rs/pull/492

mattjbray avatar Apr 13 '24 20:04 mattjbray

I guess that also works. It is disheartening that that PR been open since 2022.

adamnemecek avatar Apr 14 '24 01:04 adamnemecek

Is it possible to add a test that shows the problem?

jrmuizel avatar May 23 '24 13:05 jrmuizel

The problem is that currently the api does not allow for consuming events.

adamnemecek avatar May 24 '24 07:05 adamnemecek