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

Update mouse-usage.rst because code produces error #587

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TDHster
Copy link

@TDHster TDHster commented Feb 15, 2024

Main problem was that event may not have attribute .button as the error indicates.

mouse.Events() can have 3 main types: pynput.mouse.Events.Click, pynput.mouse.Events.Move and pynput.mouse.Events.Scroll (as far as I know)

And among those three, last two of those do not have attribute .button surely.

So if we want to handle this problem, I guess we need to use exception handling.

https://stackoverflow.com/questions/73543563/attributeerror-move-object-has-no-attribute-button-mouse-listener-with-pyn

Main problem was that event may not have attribute .button as the error indicates.

mouse.Events() can have 3 main types: pynput.mouse.Events.Click, pynput.mouse.Events.Move and pynput.mouse.Events.Scroll (as far as I know)

And among those three, last two of those do not have attribute .button surely.

So if we want to handle this problem, I guess we need to use exception handling.


https://stackoverflow.com/questions/73543563/attributeerror-move-object-has-no-attribute-button-mouse-listener-with-pyn
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

Successfully merging this pull request may close these issues.

1 participant