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

Win32 suppress after enqueue #507

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

Conversation

notEvil
Copy link

@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

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
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