Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling mouse.double_click inside callback of mouse.on_click leads to infinite recursion #12

Open
redstoneleo opened this issue Dec 10, 2017 · 1 comment

Comments

@redstoneleo
Copy link
Contributor

Calling mouse.double_click inside callback of mouse.on_click leads to infinite recursion, so better to distinguish between a mouse click and a double click

I don't know if this issue is related to this post

My test code as follows, be sure to save all your unsaved work and you can fore a stop to a running Python program before test the issue , or else the infinite recursion mouse clicks might cause some problems to your work!


import mouse
import time



def onMouseClicked():
     print('1 single click')
     mouse.double_click(button='left')  #
     print('2 double click')
    # time.sleep(1000)
#     mouse.click(button='left')  #
#     print('3 single click')
#     mouse.unhook_all()
#mouse.on_double_click(onMouseClicked)
mouse.on_click(onMouseClicked)
mouse.wait(button='right', target_types=('double', 'up'))  #

@ninhhuynh
Copy link

#113 solve this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants