Open Ananym opened 1 week ago
Spent more time on this... Looks like a basically a coincidence that the mouse side of this works: the exception is handled generically, allowing the thread to continue, but the keyboard side doesn't have the abstract exception handler decoration. However, I still have no idea why the event actually gets suppressed in the mouse side - given it goes through an event queue, that doesn't look possible? Yet.. it's what's happening
I've been trying to call suppress_event inside the on_press hook for the keyboard. As far as I can tell from the source, this pattern should work - suppressing events in the regular hooks is definitely more convenient than having to do all your event logic with the windows event data provided by win32_event_filter. However, while it works just fine for mouse events, trying to suppress a keyboard event like this causes the thread to instantly end for me. No exception is shown, even if the thread has been joined, so I've been struggling to work out exactly what's going on.
Would appreciate any comments on the cause, or a better pattern that's similarly convenient, or just tips on how to get started debugging this. Win 10, python 3.11.