-
Notifications
You must be signed in to change notification settings - Fork 24
MNT: Add type hints to Mouse methods #61
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
Merged
joao-voltarelli
merged 8 commits into
botcity-dev:main
from
welli7ngton:mnt/annotate_mouse_methods
Feb 17, 2025
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e21b34f
MNT: Add type hints to Mouse methods
80d1d50
MNT: Add type hints to Mouse methods
welli7ngton b740d5f
MNT: Refactor mouse button handling and improve code consistency
welli7ngton e2c8ab5
FIX: solving conflict
welli7ngton 046e6e2
FIX: removing unused type, that 'Literal' import was added when i was…
welli7ngton 52b3cbe
fix: remove
welli7ngton 1e9cd5a
fix: removing unused import
welli7ngton 1d6408e
FIX: Adjusting mouse_down and mouse_up methods
joao-voltarelli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@welli7ngton I think we'll just need to make a small adjustment.
In the
click()
,click_relative()
,mouse_down()
andmouse_up()
methods we can remove this treatment:mouse_button = mouse_map.get(button, "left")
I say this because the
_mouse_click()
method that is invoked expects the parameter to be of type'str'
. This treatment means themouse_button
variable can be an Enum (if it exists in themouse_map
dictionary).With this, the internal check that is done within the
_mouse_click()
method would cause theValueError
exception to be thrown: https://github.com/botcity-dev/botcity-framework-core-python/blob/815196110f09b028b9546c0af8bc523cf1ecc8d8/botcity/core/input_utils.py#L77#L80Since this parameter value check is already done in
_mouse_click()
, I think we can leave it out of the methods in bot.py. What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @joao-voltarelli, i see now, it also ensure consistency in handling mouse button inputs. I agree, ill solve this soon, thanks for the feedback