-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
Add desktop
argument to mouse.get_pos
and mouse.get_pressed
#3105
Add desktop
argument to mouse.get_pos
and mouse.get_pressed
#3105
Conversation
desktop
argument to mouse.get_pos
and mouse.get_pressed
desktop
argument to mouse.get_pos
and mouse.get_pressed
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.
I found the position of get_pos(desktop=True)
is not scaled in SCALED mode.
Will this cause a problem (?
Hi :) |
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.
Okay, I prefer this API over the previous 2 PRs that were adding this functionality with a new function.
One thing that could be potentially discussed further is the keyword argument naming. Is desktop
good enough or is there something better? I am fine with desktop
, but I'm open to other suggestions.
We could also make a note about the SCALED thing in the docs |
I used Andrew's suggestion. SDL calls it global but I don't think it conveys enough information. absolute was an option but it can be confused with clamped or abs() |
Is it necessary to specify that it's not effected by the SCALED flag? |
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.
LGTM! Thanks for the PR!
I'm also fine with the desktop
argument, it feels more intuitive.
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.
LGTM 👍
I like how it expands on existing functions while adding more, related, functionality.
This pull request combines the following PRs adopting a "better" API (suggested by @ankith26 ) while retaining the functionality. To know about usecases or why please check them both:
pygame.mouse.get_desktop_pos
#3070pygame.mouse.get_desktop_pressed
#3101Closes #3070
Closes #3101
Combined Sample Code