mouse
mouse copied to clipboard
No way to discard/suppress mouse events
In the keyboard
library it is possible to suppress a hotkey so the keyboard event isn't sent to the rest of the system when the user is trying to set up a "hotkey". The mouse
library does not have the same feature when setting up hooks, and I'm guessing it's because suppressing mouse events could make a computer somewhat unusable. I feel like there should still be a way to "discard" or "suppress" specific mouse events within the callback function provided to hook
. Maybe something like WheelEvent.discard
or ButtonEvent.suppress
? Would this be possible? I am working on a set of macros and I need to capture mouse wheel events without processing them, while the alt
key is pressed. I'm having a lot of trouble finding any python library that supports discarding/suppressing specific mouse events. pynput
lets me suppress mouse input but it ends up applying to EVERY single mouse event, not just specified mouse events. If I try to process these suppressed mouse events manually, this causes a lot of problems since it can't really keep up with the amount of move events.
Having the ability to capture specific mouse events without having the system process those events would be a very useful feature for scripting complex macros.