Repository navigation
Add desktop argument to mouse.get_pos and mouse.get_pressed - #3105
Conversation
desktop argument to mouse.get_posand mouse.get_presseddesktop argument to mouse.get_pos and mouse.get_pressed
yunline
left a comment
There was a problem hiding this comment.
I found the position of get_pos(desktop=True) is not scaled in SCALED mode.
Will this cause a problem (?
Hi :) |
ankith26
left a comment
There was a problem hiding this comment.
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? |
bilhox
left a comment
There was a problem hiding this comment.
LGTM! Thanks for the PR!
I'm also fine with the desktop argument, it feels more intuitive.
MyreMylar
left a comment
There was a problem hiding this comment.
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