Open DollieSon opened 4 months ago
The docs aren't the best on this, I agree. What the docs are saying is that you can call suppress_event on your listener during the win32_event_filter function to suppress the event (this will not then trigger the other hooks on the listener)
What I've found is that with the mouse listener on windows in particular, you can call suppress_event in the other hooks too. For instance, this works fine:
mouse_listener = mouse.Listener()
def on_scroll(x,y,dx,dy):
mouse_listener.suppress_event()
mouse_listener.on_scroll = on_scroll
def on_click(x,y,button,pressed):
if button == mouse.Button.right:
mouse_listener.suppress_event()
mouse_listener.on_click = on_click
This pattern doesn't work for me with the keyboard. Might open another issue for that.
I've tried following the faq but I dont understand what the 'listener' stood for and yes i've tried using 'self.' here is the closest thing i've come so far:
` def test3(): def win32_event_filter(msg,data): if msg != 512: print(data.mouseData) print("Something was presed")
`