Skip to content

Remove Window.grab, add Window.grab_mode and Window.grabbed #2164

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

Closed
wants to merge 9 commits into from

Conversation

yunline
Copy link
Contributor

@yunline yunline commented May 16, 2023

Issue #2162
So I suggest, remove Window.grab, add Window.grab_mode and Window.grabbed.

  • Window.grab_mode is readable and writable.
  • Window.grabbed is read only.
Condition Window.grab_mode Window.grabbed
Window.grab_mode=False False False
Window.grab_mode=True, but the mouse is not confined to the window True False
Window.grab_mode=True, and the mouse is confined to the window True True

@yunline yunline added enhancement _sdl2 pygame._sdl2 video pygame.video labels May 16, 2023
@yunline yunline requested a review from a team as a code owner May 16, 2023 06:16
@yunline
Copy link
Contributor Author

yunline commented May 22, 2023

I've made a video to demonstrate how these two attributes work.
The window on the left ( w1) is set to grab_mode but not always grabbed.

07.mp4

@ankith26 ankith26 added the New API This pull request may need extra debate as it adds a new class or function to pygame label May 25, 2023
@yunline yunline marked this pull request as draft July 22, 2023 09:03
@yunline
Copy link
Contributor Author

yunline commented Oct 15, 2023

Close because #2379 implemented this.

@yunline yunline closed this Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New API This pull request may need extra debate as it adds a new class or function to pygame _sdl2 pygame._sdl2 video pygame.video
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants