mouse icon indicating copy to clipboard operation
mouse copied to clipboard

The mouse.DOWN type hook does not work correctly.

Open Goatghosts opened this issue 1 year ago • 0 comments

On my Windows 11 system, this piece of code does not work correctly. The code is not able to detect every click and display the corresponding message in the console. In this case, the mouse.UP event works correctly, but it does not suit me at all. Try checking it for yourself and maybe you will notice the problem too.

def main():
    mouse.on_button(lambda: print("Mouse down"), buttons=mouse.LEFT, types=mouse.DOWN)
    try:
        while True:
            time.sleep(0.01)
    except KeyboardInterrupt:
        pass
    finally:
        mouse.unhook_all()


if __name__ == "__main__":
    main()

Goatghosts avatar Feb 26 '24 13:02 Goatghosts