Skip to content

Win32 suppress after enqueue#507

Open
notEvil wants to merge 3 commits intomoses-palmer:masterfrom
notEvil:suppress_after
Open

Win32 suppress after enqueue#507
notEvil wants to merge 3 commits intomoses-palmer:masterfrom
notEvil:suppress_after

Conversation

@notEvil
Copy link
Copy Markdown

@notEvil notEvil commented Oct 19, 2022

This adds an option specific to win32 which introduces a new filter.

The existing filter either suppresses the event early in case of raise ..., or ignores the event and passes it on in case of return False (the comment # Suppress further propagation of the event if it is filtered is plain wrong)

The new filter suppresses events after they have been enqueued.

This allows suppression of injected events as demonstrated in https://gitlab.com/notEvil/keyboard/-/blob/a868e952787d0a779b129f9382c00d907fc16a2a/keyboard/windows/evdev/__init__.py#L32 and might solve issues like #455.

Feel free to adjust names and code style

@notEvil notEvil changed the title - win32: added suppress after enque Win32 suppress after enqueue Oct 20, 2022
@ymirv
Copy link
Copy Markdown

ymirv commented Jun 15, 2023

One comment: The win32 mouse handler also derives from _util/win32.py, and so you end up with NotImplementedError in that case

@notEvil
Copy link
Copy Markdown
Author

notEvil commented Jun 16, 2023

Thanks, I've adjusted the class similar to keyboard._win32.Listener.

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