Closed gh0styxx closed 2 years ago
Thank you for your report.
Have you tried calling my_function
only when pressed
is True
? The on_click
callback will be triggered when a button is pressed as well as released.
I do not think this is caused by a bug in this library, so I will close this issue. If you think otherwise, please reopen.
Thank you, I missed this variable. it helps to solve my problem. Thanks!
Description If I want to perform an action while clicking the middle button on my mouse (scroll button, but I click it, not scroll) the action is performed once. When I release the button, the action is performed once again, because when I release the middle button it is known as pressing. I have the same issue with using another buttons on my mouse, like Button.left or Button.right. If I try to perform the same function using a key on the keyboard, the pressing and releasing the button works like it should, the action is performed only once.
Platform and pynput version I use MacOS 12.3 Monterey and pynput 1.7.6
To Reproduce
If physically click middle button once and release it, the code under "my_function" will perform twice.